22 ms·
Providing It was syntactically correct the first call would assign e to a variable b for each iteration ( pretty pointless ) The arr.map providing you had a va
by nullandvoid 7y ago
Providing It was syntactically correct the first call would assign e to a variable b for each iteration ( pretty pointless )
The arr.map providing you had a variable on the left side would output the result of each iteration into said array ( so an array containing all b values - however I guess you meant arr.map(e => e)
- wongarsu 7y ago> Providing It was syntactically correct Providing arr is iterable (e.g. an array) it's perfectly valid js. Your linter might scream at you to add braces and a semicolon, but neither is needed for correctness here.
- jacobwilliamroy 7y agoNope. I meant arr.map(e=>b) . I try to reimplement pointless code, I get more pointless code.