How to use 'javascript array from 1 to n' in JavaScript

Every line of 'javascript array from 1 to n' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
60function createArray(N) {
61 return Array.apply(null, { length: N }).map(, Number)

Related snippets