SyntaxFix
Write A Post
Hire A Developer
Questions
As a variant you can use combiantion _.map and _.ary methods from the lodash library. Whole transformation will be a more compact. Here is example from the official documentation:
_.map
_.ary
_.map(['6', '8', '10'], _.ary(parseInt, 1)); // ? [6, 8, 10]