Explain how you can apply afor…inloop.

What will be an ideal response?


The syntax offor..inloop is as follows:?for (prop in obj) {commands}wherepropreferences the properties contained within theobjobject.?Note thatfor…inloops do not follow a specific order because properties can be listed and read out in any order. For item collections in which order is important, use anArrayobject with array values assigned index numbers. Only properties that are countable or enumerable are accessible tofor…inloops. You can determine whether a property is enumerable using the followingpropertyIsEnumerable()method:?obj.propertyIsEnumerable(prop)?whereobjis the object andpropis the property.

Computer Science & Information Technology

You might also like to view...

The intersection of each row and column is called a _____.

A. block B. box C. location D. cell

Computer Science & Information Technology

The threads in a curses-based animation program use a mutex because

A. all the threads use a shared timer B. curses functions are not reentrant

Computer Science & Information Technology

A(n) ______ provides a shortcut for a device to send data directly to memory, bypassing the CPU.

A. IRQ B. I/O address C. HCL D. DMA channel

Computer Science & Information Technology

Which of the following protocols are used to provide accurate time to network devices?

A. SMTP B. FTP C. TLS D. NTP

Computer Science & Information Technology