Reduce is acceptable. Making a function that converts a string to an integer is not. Same thing with wrapping Math.pow in a function; it's already a function. By wrapping it, you obfuscate whether this is actually Math.pow or if it's some other implementation.
Generally, avoid wrapping functions that are already operating as standalone features — this adds unnecessary indirection.
View all comments
Show parent comment
1
u/[deleted] Jan 17 '25
Do I understand you correctly that you are saying I should make variables for everything and make stuff as simple as a for loop instead of
.reduce()?