Ad
  • Custom User Avatar

    You only manage to do one-level of nesting (the outer-most layer). You should consider using a stack-based or recursive approach

  • Custom User Avatar

    Explanations from JavaScript Garden
    Also look at Kata description more attentively: "We want to create a function, which returns an array of functions".
    Not array of integers, but functions. In your code callbacks.push(handle(i)); is equivalent to callbacks.push(i);.
    Hope it helps.