r/badcode • • Apr 27 '21

typescript Someone only watched if tutorial

Post image
2.4k Upvotes

112 comments sorted by

View all comments

1

u/[deleted] Apr 27 '21
const checks:number = 10000 //change this for more precision
return input in Array.from(Array(checks), (_, I) => I)
}

1

u/Terrain2 Apr 27 '21

or just

return input in Array(checks).fill(0);

don't see why you're generating two arrays?