js how to get type of a var code example
Example: javascript find type of variable
> typeof "foo"
"string"
> typeof true
"boolean"
> typeof 42
"number"
if(typeof bar === 'number') {
//whatever
}
> typeof "foo"
"string"
> typeof true
"boolean"
> typeof 42
"number"
if(typeof bar === 'number') {
//whatever
}