Array.prototype.entries()

 also returns an iterable over [key, value] pairs:

Therefore, 

 gives you a way to treat iterated items differently, depending on their position:

This function is used as follows:

 

 

 

Fullstack4u.com shares web development tips for full stack web technologies and is helping share the passion to web developers worldwide.

Leave a Reply

Your email address will not be published. Required fields are marked *