Javascript examples for JSon:JSon Object
Accessing values of JSON object via hasOwnProperty
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from w ww . j ava 2s .c om*/ var data = [{ x: "something1", y: "something2", z: "10", w: "20" }]; for (var i = 0; i < data.length; i++) { for (var propertyName in data[i]) { if (data[i].hasOwnProperty(propertyName)) { console.log(data[i][propertyName]); } } } } </script> </head> <body> </body> </html>