JavaScript typeof |
Example |
C++ type (roughly) |
number |
var x=3; |
int, float, double |
string |
var x="bob"; |
std::string, char * |
boolean |
var x=false; |
boolean |
function |
var x=function() {...}; |
any function, method |
object |
var x={"y":3}; |
any class, struct, or map! |
object |
var x=[2,3,5]; |
std::vector, array |
undefined |
var x; |
void |