-2

Is there a way that I can possibly do [200:204] in JavaScript to generate this array [200, 201, 202, 203]?

0

1 Answer 1

2

You can do

const range = (a, b) => Array(b-a).fill(a).map((v, i) => v + i);

And then use

const arr = range(200, 204);
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.