DEV Community

Discussion on: 10 Practical JavaScript Tricks

Collapse
 
bdougherty profile image
Brad Dougherty

Actually, leaving out the starting value is fine as long as your array is not empty. When you do that, it will use the first element as the starting value. I think in general it is better to be explicit and provide one though.