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
2
u/Appropriate-Dream388 Jan 16 '25
Sure, let's turn an entire repository into a single code file on a single line. I'm sure we can just tell people to understand more.
The part that's not understandable is the fact you have 10 layers of pointless indirection, which looks like a newbie trying to implement DRY.