JavaScript Window print() Method: Page print in JavaScript is very simple code, which is used to print the content of the web pages. The print() method prints the contents of the current window. It opens Print dialog box which lets you choose various printing options. We can print contents of …
Printing all enumerable properties using for..in loop We can print all enumerable properties either own or inherited of cat object using JavaScript for..in loop. for (var prop in cat) { console.log (prop); } Using the for..in loop, all enumerable properties can be iterated.