Home > Blockchain >  How to skip first iteration in javascript for-of loop
How to skip first iteration in javascript for-of loop

Time:12-02

I know how to skip first iteration in javascript foreach loop

dataObject.slice(1).forEach((row) => {});

I want to know how to do the same thing using for of loop in javascript, please help me, thanks

for( const row of dataObject )

CodePudding user response:

The same way you're skipping it with forEach - replace the dataObject expression with dataObject.slice(1).

for( const row of dataObject.slice(1) )
  • Related