javascript store this in variable code example
Example 1: how to store variable in javascript
var example1 = "hello this is string variable" ; //this is string variable
var example2 = 12345 ; //this is numeric variable
var example3 = true ; //boolean variable
Example 2: js store function in variable
var foo = function(a){ return a * 2; }
var bar = foo(2);
foo = function(a){ return a / 2; }
bar = foo(bar);