Ad
  • Custom User Avatar

    Hi, it's like a math function. say for a function f(x) = 2x.. u could code like

    function f(x) { return 2x; }

    or simply f = x => 2x

    it's the new es6 syntax, like a functional language. hope it helps

  • Custom User Avatar

    % means Modulo operation.

    https://en.wikipedia.org/wiki/Modulo_operation

    if (x % 3 === 0) means x could be one of the values 0, 3, 6, 9, ..., x, 3x, ..., it could be -3, -6, -9 and ...

  • Custom User Avatar

    Please correct the decimal points, it's overkilled.

  • Custom User Avatar

    it's used to indicate a variable you don't need to use, it's yet another special way to name a variable. You could use unused.

    spcial character like undercore is useful, for example, if you want to add a key named constructor in an object, it's better to add the key like _constructor

  • Custom User Avatar

    @g964 Do you refer to the FFC in Chicago? Lol...

  • Custom User Avatar

    Please fix the problem, thanks.

    I did not implement any code, I simply return an empty array, and got the this error.

    [eval]:14 after = global.after;Test.assertSimilar(4...palindromeBelow(2), [1, 3] ^^^^^^^^^^^^^^^ SyntaxError: Unexpected identifier at Object. ([eval]-wrapper:6:22)
    at
    at evalScript (node.js:565:25)
    at startup (node.js:80:7)
    at node.js:935:3

  • Custom User Avatar

    Please double check the random tests. I print out the input arguments, it doesn't match those arrays you mentioned after the 'value not expected'.

    [ [ 14, 6 ],
    [ 6, 72 ],
    [ 78, 63 ],
    [ 32, 77 ],
    [ 39, 30 ],
    [ 47, 47 ],
    [ 55, 45 ],
    [ 34, 95 ],
    [ 2, 52 ],
    [ 50, 25 ],
    [ 47, 95 ],
    [ 1, 85 ],
    [ 39, 22 ],
    [ 77, 30 ],
    [ 31, 95 ],
    [ 9, 14 ],
    [ 32, 79 ],
    [ 6, 78 ],
    [ 62, 3 ],
    [ 30, 76 ],
    [ 3, 13 ],
    [ 87, 16 ],
    [ 30, 89 ],
    [ 10, 20 ],
    [ 92, 7 ],
    [ 56, 37 ],
    [ 35, 37 ],
    [ 29, 66 ],
    [ 78, 96 ],
    [ 60, 24 ],
    [ 50, 55 ],
    [ 37, 7 ],
    [ 47, 69 ],
    [ 28, 98 ],
    [ 44, 69 ],
    [ 55, 65 ],
    [ 15, 95 ],
    [ 47, 73 ],
    [ 17, 96 ],
    [ 21, 7 ],
    [ 97, 2 ],
    [ 79, 96 ],
    [ 46, 52 ],
    [ 78, 70 ],
    [ 42, 79 ],
    [ 71, 92 ],
    [ 87, 38 ],
    [ 8, 79 ],
    [ 64, 78 ],
    [ 73, 68 ],
    [ 9, 47 ],
    [ 25, 16 ],
    [ 87, 21 ],
    [ 81, 92 ],
    [ 27, 49 ],
    [ 99, 70 ],
    [ 50, 60 ],
    [ 31, 17 ],
    [ 44, 19 ],
    [ 94, 26 ],
    [ 99, 1 ],
    [ 56, 75 ],
    [ 28, 77 ],
    [ 10, 21 ] ]

    [ [ 21, 10 ],
    [ 77, 28 ],
    [ 75, 56 ],
    [ 1, 99 ],
    [ 26, 94 ],
    [ 19, 44 ],
    [ 17, 31 ],
    [ 60, 50 ],
    [ 70, 99 ],
    [ 49, 27 ],
    [ 92, 81 ],
    [ 21, 87 ],
    [ 16, 25 ],
    [ 47, 9 ],
    [ 68, 73 ],
    [ 78, 64 ],
    [ 79, 8 ],
    [ 38, 87 ],
    [ 92, 71 ],
    [ 79, 42 ],
    [ 70, 78 ],
    [ 52, 46 ],
    [ 96, 79 ],
    [ 2, 97 ],
    [ 7, 21 ],
    [ 96, 17 ],
    [ 73, 47 ],
    [ 95, 15 ],
    [ 65, 55 ],
    [ 69, 44 ],
    [ 98, 28 ],
    [ 69, 47 ],
    [ 7, 37 ],
    [ 55, 50 ],
    [ 24, 60 ],
    [ 96, 78 ],
    [ 66, 29 ],
    [ 37, 35 ],
    [ 37, 56 ],
    [ 7, 92 ],
    [ 20, 10 ],
    [ 89, 30 ],
    [ 16, 87 ],
    [ 13, 3 ],
    [ 76, 30 ],
    [ 3, 62 ],
    [ 78, 6 ],
    [ 79, 32 ],
    [ 14, 9 ],
    [ 95, 31 ],
    [ 30, 77 ],
    [ 22, 39 ],
    [ 85, 1 ],
    [ 95, 47 ],
    [ 25, 50 ],
    [ 52, 2 ],
    [ 95, 34 ],
    [ 45, 55 ],
    [ 47, 47 ],
    [ 30, 39 ],
    [ 77, 32 ],
    [ 63, 78 ],
    [ 72, 6 ],
    [ 6, 14 ] ]
    Value not what is expected for [[14,6],[6,72],[78,63],[32,77],[39,30],[47,47],[55,45],[34,95],[2,52],[50,25],[47,95],[1,85],[39,22],[77,30],[31,95],[9,14],[32,79],[6,78],[62,3],[30,76],[3,13],[87,16],[30,89],[10,20],[92,7],[56,37],[35,37],[29,66],[78,96],[60,24],[50,55],[37,7],[47,69],[28,98],[44,69],[55,65],[15,95],[47,73],[17,96],[21,7],[97,2],[79,96],[46,52],[78,70],[42,79],[71,92],[87,38],[8,79],[64,78],[73,68],[9,47],[25,16],[87,21],[81,92],[27,49],[99,70],[50,60],[31,17],[44,19],[94,26],[99,1],[56,75],[28,77],[10,21]] and [[21,10],[77,28],[75,56],[1,99],[26,94],[19,44],[17,31],[60,50],[70,99],[49,27],[92,81],[21,87],[16,25],[47,47]] - Expected: false, instead got: true

  • Custom User Avatar

    having more test cases would be perfect.

  • Custom User Avatar

    @jolaf please take a look again the test case in JavaScript, the length of the morse code in the case SOS is 9, without any delimiter, each position is either dot or dash. I think '', an empty string, is the correct answer, but it expects SOS.

  • Custom User Avatar

    in the description of your question, the first element of the example is a typo, with an extra n.

    "

    For example one to eight is as follows: anane, adak, adak anae, ...

    "

  • Custom User Avatar

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

  • Custom User Avatar

    Please help investigate it. Thanks. I also have similar problems.

  • Custom User Avatar

    the tests contain defects, why all the random are negative.

  • Custom User Avatar

    Caught you cheating, DO NOT TRY TO USE RETURN
    Please use a way that only works for this kata.

  • Custom User Avatar

    Great article, yep, I did use the last one. Since there is a tail before the loop, I need to call the method twice.

  • Loading more items...