get the type of a javascript object