Javascript examples for Object:Object Property
Check property with hasOwnProperty method
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {/* w w w. j ava 2 s. c o m*/ function getKeys(obj) { var keys = [], i; for (var i in obj) { if (obj.hasOwnProperty(i)) { keys.push(i); } } return keys; } console.log(getKeys({TEST: "abc"})); }); </script> </head> <body> </body> </html>