<html>
<head>
<title>Object.getOwnPropertyNames() Example</title>
<script type="text/javascript">
function Person(){
}
Person.prototype.name = "Nicholas";
Person.prototype.age = 29;
Person.prototype.job = "Software Engineer";
Person.prototype.sayName = function(){
alert(this.name);
};
var keys = Object.getOwnPropertyNames(Person.prototype);
alert(keys); //"constructor,name,age,job,sayName"
</script>
</head>
<body>
<p>Note: this example only works in browsers that have implemented the ECMAScript 5 <code>Object.defineProperty()</code> method (IE9, Firefox 4, and Chrome 7).</p>
</body>
</html>