Ad
  • Custom User Avatar

    "Boom, you failed to cut the wire"

    This is more riddle than coding challenge, and apparently I am bad at riddles. Can someone give me a hint?

    var wireCode = 1; // Find the wire.
    var Bomb = {
    CutTheWire: function(wireKey) {
    if (wireKey = 1) {
    return;
    }
    },
    Explode: function() { return }
    }
    Bomb.CutTheWire(wireCode);

  • Custom User Avatar

    Can someone provide an example of what a test looks like for this kata? Even just how to test the call in the kata description.

    Here's my code:

    function once(fn) {
    var executed = false;
    return function(variable) {
    if (!executed) {
    executed = true;
    fn(variable);
    }
    }
    }

  • Custom User Avatar

    I've passed the kata. Just trying to understand the guts of the call stack.

    This is the line that causes the error:
    addWord(addWord(list, 'how are you'), 'goodbye');

    So I'm guessing that because the nested call to addWord hasn't returned 'goodbye' cannot be appended.

  • Custom User Avatar

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

  • Custom User Avatar
  • Custom User Avatar

    My code passes all the test except for this one. It's a simple algorithm so I have no idea why it would fail for this one test.

  • Custom User Avatar

    Same here. Still hasn't been corrected

  • Custom User Avatar

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

  • Custom User Avatar

    Passed all the test cases. But when I submit I get:
    TypeError: Reduce of empty array with no initial value
    at Array.reduce
    at Array.sum
    at Array.average
    at Test.it
    at array
    at Test.describe

    The code has passed through eslint with no problem. I'm not sure what they're getting at with this

  • Custom User Avatar

    How to round in order to get the expected results?