how to alert javascript object

后端 未结 6 2145
忘了有多久
忘了有多久 2020-12-06 11:50

I am trying to study the jquery class, but I have a hard time debugging an object because I can\'t see the element inside of it



        
6条回答
  •  萌比男神i
    2020-12-06 12:15

    Convert your array or object to a JSON object using stringify.

    Example:

    var obj = { "name":"bayiha", "age":30, "city":"Eseka"};
    var myJSON = JSON.stringify(obj);
    
    alert(myJSON);
    

    for more info clik here

提交回复
热议问题