javascript - What does "function" == typeof variable mean? -


if ("function" == typeof type) {               msg = type;                type = "";     } 

i quite new javascript. i've read third party js book [http://thirdpartyjs.com/]. looking @ few example codes understand logic. i've got struck @ part of script. question what's function of if statement? why function in "" . mean function object?.

thanks in advance

what's function of if statement?

it checks whether type variable function reference or not

why function in ""

because typeof returns string

does mean function object?

functions objects indeed, i'm not sure mean question exactly.


Comments