How to access variables from JavaScript

if i add app connect variable to my page, how can i access the variable value and how to change the value in javascript?
i have this now but im sure there is better way
var.dmxComponent.data['value']

Community Page
Last updated: