Chrome Extension

Loop n times in React

Array.apply(null, { length: 20 }).map((e, i) => (
  <span className="busterCards" key={i}>
    {e}
  </span>
));
We are a bunch of lazy programmers so we developed this chrome extension
search code from your favorite search engine
Install Now

If you want to iterate n times using map in the React template you can use this code snippet. Here we have applied a length of 20 to the array so it will iterate 20 times.

Was this helpful?
0 Comments
Open Code Manager We are hiring