Skip to content
Advertisement

Tag: challenge-response

Javascript function challenge add(1,2) and add(1)(2) both should return 3

A friend of mine challenged me to write a function that works with both of these scenarios My instinct was the write an add() function that returns itself but I’m not sure I’m heading in the right direction. This failed. So I started reading up on functions that return other functions or return themselves. http://davidwalsh.name/javascript-functions JavaScript: self-calling function returns a

Advertisement