Ad
  • Custom User Avatar

    Just move "var numbers = []"" inside the function. It's better to use let/const instead var.
    Anyway I'm not sure why declaration outside the function doesn't work well, but the thing is that console.log(numbers) shows quite strange results in the Output

  • Custom User Avatar

    For JS If you need to know the inputs just add console.log to your code.
    For example:
    function testFunction(values){
    console.log(values)
    ...you code...
    return ...
    }