Ad
  • Custom User Avatar

    Well that was fantastic XD

  • Custom User Avatar

    Voile you are beyond awesome, thanks so much for the detailed explanation! I honestly hadn't paid that Node setting up there any mind, but I'll definitely will from now on :D

  • Custom User Avatar

    If you look at above the code window there's a dropdown next to language version (the one says JavaScript) and it should say Node something. That's the version of the language you're using.

    It's very important because you need to check the compiler/runtime version to know what's available and what's deprecated (e.g Node 0.11 won't have any ES6 stuff) ;-) For Node you should choose the latest version in general, but I wouldn't suggest the Babel ones because of the above reason.

    Oh, and by the way, Babel is a transpiler for JS. Basically it takes JS code and tranform it into different JS code, for compability or (psuedo) support for newer language features ahead of the JS engine version.

  • Custom User Avatar

    Ah! You're right, I had an else if statement without any arguments set up. ::facepalm::
    I have a question, what do you mean by Babel language versions? I'm still a extreme novice with JS and I'm not familiar with the term or what it involves.

  • Custom User Avatar

    This looks like your code's problem. Check parentheses and braces ;-)

    (Also I'd suggest to avoid the use of the Babel language versions whenever possible, they give very bad error messages about syntax errors in code.)

  • Custom User Avatar

    I tried attempting the blind cases and got this error in the console: "Error: kata.js: Unexpected token, expected ( (18:10)"

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Your function will be called many times. Think about what happens at the second call ;-)

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution