Array Range from 1
Object.assign(Number.prototype, {
*[Symbol.iterator]() {
for (let i = this; i--;)
yield this - i;
}
});
console.log([...3]);
I saw this on twitter a little while back. Tweet was from James Padolsey. A fun trick, the thread is pretty entertaining.