javascript-allonge
javascript-allonge copied to clipboard
named functions incorrect syntax?
in https://leanpub.com/javascript-allonge/read#leanpub-auto-limits
limits
Named function expressions have limits. Here’s one such limit: You can do simple recursion, but not mutual recursion. For example:
var even = function (num) even { return (num === 0) || odd( num - 1) };
var odd = function (num) odd { return (num > 0) && even(num - 1) };
shouldn't those functions be
var even = function even (num) { return (num === 0) || odd( num - 1) };
var odd = function odd (num) { return (num > 0) && even(num - 1) };