Javascript Best Practices - Use For In Loops

For loops can be shortened and cleaned. Let’s see an example:

Long form:

const friends = ['amar', 'akbar', 'anthony'];
for (let i = 0; i < friends.length; i++){

Short / clean form:

const friends = ['amar', 'akbar', 'anthony'];
for (const friend in friends){

Nordible is a digital solutions provider helping organizations achieve their digital goals.

We develop and measure digital solutions, implement impactful brand promotion and SEO strategies and develop software driven by rigorous testing that help your business succeed online and beyond.

You can contact us at for business inquiries.

Follow us: