Cum afisam un obiect in JS

Daca vrem sa vedem ce contine o variabila de tip obiect sau array…cum facem?

Avem doua solutii:

1. alert(myObj.toSource());
2. for (key in testObj){ alert (“testObj[“+key +”] = “+testObj[key]); }

eu prefer prima varianta.

Leave a Reply

Your email address will not be published. Required fields are marked *