var meaning in js code example
Example 1: how to define variable in javascript
var <variable-name>;
var <variable-name> = <value>;
Example 2: js what does var mean
Used to create a variable that is globally scoped when not used in a function.
When it is used in a function, it can only be used in that function and not
outside of it. This statement is comparable to let but more globalized.