I have this code:
if(typeof x == 'object')
return "{"+Object.keys(x)+"}";
It results in (Chrome):
Uncaught TypeError: Object.keys called on non-object
Can anybody tell me what's going on here? Btw: Firefox does the same.
ps: Don't know what the object is. Firefox debugging failed me.
x? Maybe it'snull?xnull? typeof will returnobjectfor a null valuetype nullis"object", and would cause this exact error :)