use a var from a function javascript code example
Example 1: how to define variable in javascript
var <variable-name>;
var <variable-name> = <value>;
Example 2: javascript define variable
var variable1 = "some variable content";
var <variable-name>;
var <variable-name> = <value>;
var variable1 = "some variable content";