by benatkin · 3y ago · 0 comments
['10', '10', '10'].map(val => parseInt(val))
Leading zeroes can often be considered invalid input, and you may be able to safely assume that it has been dealt with already.Also the parens around a single argument of an arrow function are a superstitious thing suggested by some well-known react developer a while back, I think.
The extra parentheses is just habit from Prettier formatting :)
['07', '08', '09'].map(val => parseInt(val)) // => [7, 0, 0]
['07', '08', '09'].map(val => parseInt(val)) // => [7, 8, 9]