Create an array of numbers in the given range
ksrakhilesh opened this issue · comments
ksrakhilesh commented
Should Be
const range1 = (min, max) => Array(max - min + 1).fill(0).map((_, i) => min + i);
phuocng commented
@ksrakhilesh Yes, both returns the same result. Actually, I used the same approach initially.
Anyway, I updated the post using both ways.
Martin Schilliger commented
Just curious: Is there a benefit on either approach?
phuocng commented
@martinschilliger No, it's the same. It's just another way to describe.