SyntaxFix
Write A Post
Hire A Developer
Questions
One can create an empty array, fill it (otherwise map will skip it) and then map indexes to values:
Array(8).fill().map((_, i) => i * i);