Ad
  • Custom User Avatar

    In the sample test for javascript, the test is for 1 and 2, not 1 and 3.

    Test.describe("addBinary(1,2)", function() {
      var results1 = addBinary(1,2);
      Test.it("Should return something that isn't falsy", function() {
        Test.expect(results1, "Something is wrong, no results!");
      });
      Test.it("Should return \"11\"", function() {
        Test.assertEquals(results1, "11");
      });
    });
    

    See?

  • Custom User Avatar

    I think there is a mistake with the test - the sum of (1,3) in binary is not '11' but '100' - when I press the 'atempt' button its worked

  • Custom User Avatar

    you can convert it to an array by the split method, and then convert each item from string to a number:

    function iqTest(numbers) {
    var arr = numbers.split(' ');
    arr = arr.map (x => Number(x));

    //the rest...

    }

  • Custom User Avatar

    I olso made one by myself and its work for me, try this:
    const TOT_MORSE_CODE = {
    ".-": "a", "-...":"b", "-.-.": "c", "-..": "d", ".":"e", "..-.":"f", "--.":"g", "....":"h", "..":"i", ".---":"j", "-.-":"k", ".-..":"l", "--":"m", "-.":"n", "---":"o", ".--.":"p", "--.-":"q", ".-.":"r", "...":"s", "-":"t", "..-":"u", "...-":"v", ".--":"w", "-..-":"x", "-.--":"y", "--..":"z", ".----":"1", "..---":"2", "...--":"3", "....-":"4", ".....":"5", "-....":"6", "--...":"7", "---..":"8", "----.":"9", "-----":"0", "|":" "
    };