Creating range in JavaScript – strange syntax
Understanding this “hack” requires understanding several things: Why we don’t just do Array(5).map(…) How Function.prototype.apply handles arguments How Array handles multiple arguments How the Number function handles arguments What Function.prototype.call does They’re rather advanced topics in javascript, so this will be more-than-rather long. We’ll start from the top. Buckle up! 1. Why not just Array(5).map? … Read more