javaScript проверка типа переменной var
> typeof "foo"
"string"
> typeof true
"boolean"
> typeof 42
"number"
Valentino_Rossi
> typeof "foo"
"string"
> typeof true
"boolean"
> typeof 42
"number"
if(typeof variable == 'object'){
//
}