JavaScript Functional Programming - Chaining Functions and using an anonymous function
问题 I was doing a question on CodeWars and practicing some functional programming when I encountered a problem while trying to apply a function to a value. So I made a pass() function that accepts a function as an argument so that I could use an anonymous function to manipulate that value and then return it. So, in this case, it takes the value from reduce and passes it to a function so it can manipulate that value then return it. It WORKS but I really don't want to add a method to the Object