As all those prototype properties are objects, the final step would be Object.prototype because there is no other constructor prototype property upper than Object level to be examined.
Anyway if finally JavaScript can't find the property it would have produced an error stating that the property was undefined.
<!DOCTYPE html><html lang="en">
<body>
<script>
var myArray = ['element1', 'element2'];
console.log(myArray.hasOwnProperty('join'));
console.log(myArray.join());
console.log(myArray.hasOwnProperty('toLocaleString')); console.log('toLocaleString' in myArray); console.log(myArray.toLocaleString());
</script> </body> </html>
console.log(myArray.hasOwnProperty('toLocaleString')); console.log('toLocaleString' in myArray); console.log(myArray.toLocaleString());
</script> </body> </html>
No comments:
Post a Comment