Usually if you want something different returned you would pass in a different callback function. That is the nice thing about this pattern. You can accomplish different things. What exactly did you want returned?
Not great. If you just name the function something like formatScore() and use it instead of callback(). It is so much more readable. I still didn't get it what is so special about callback except that it turns the code in spaghetti.
Great Explanation!! I'm learning Js and your tutorials are by far the more complete and understandable. Keep going.
A very mind-bending exercise!!
Great teacher on youtube. Please do a series on Data Structure and algorithms based on javascript.
excellent.
Good stuff.. Many thanks..!
Thank You... 👍👍👍
How would you return all other properties with the new given score???
Usually if you want something different returned you would pass in a different callback function. That is the nice thing about this pattern. You can accomplish different things. What exactly did you want returned?
Awesome
Not great. If you just name the function something like formatScore() and use it instead of callback(). It is so much more readable. I still didn't get it what is so special about callback except that it turns the code in spaghetti.
精彩!