I have a mystery object in Javascript - please could someone tell me how to initialise a similar object?
Background: I've inherited some code that gets passed a params object from Flash. I want to 'fake' the same call, which requires manually constructing the same object. But I can't work out how to take it, because I don't know what type of object it is. (It's not the content that's the problem: it's how to initialise the object.)
Please could someone tell me whether the params object following is an array, a list, a hash or something else - or at least how I can work it out for myself, given that there is no typeof in JavaScript?
function doSomething(params) {
var txt;
for (p in params) {
txt = txt + "param:" + p + ", " + params[p] + "\n";
}
return txt;
}
Thanks!
given that there is no typeof in JavaScript?sez who? :D Tryalert(typeof params);typeof- however, it returns'object'for objects and arrays. JavaScript does not have a separate list type.