dynamic for loop react

JavaScript
Array(8).fill().map((_, i) => i * i);
Source

Also in JavaScript: