Ad
  • Custom User Avatar

    but function (x => x + 1) returned new value, maybe function must be (x => x) ?

  • Custom User Avatar

    test x => x + 1 not worked on javascript

    Log
    Input:
    Node {
    data: 70,
    next: Node { data: 76, next: Node { data: 58, next: [Object] } } }
    Output:
    Node {
    data: 71,
    next: Node { data: 77, next: Node { data: 59, next: [Object] } } }
    Function:
    x => x + 1
    Expected: '[70, 76, 58, 16, 83, 5, 82, 33, 50, -6, -6, 37, 29, 24, 30]', instead got: '[71, 77, 59, 17, 84, 6, 83, 34, 51, -5, -5, 38, 30, 25, 31]'

    test name: list is not modified