var = + javascript code example
Example 1: javascript variable
var user_name = prompt("Please enter your name:", "Type here");
alert("Hello " + user_name);
Example 2: var = {} js
//An array is a type of object intended to be only assigned numeric keys
var tmp = []; // or: var tmp = {}
tmp.one = 1;
JSON.stringify(tmp);
// array:
'[]'
// object:
'{"one":1}'