Ad
  • Custom User Avatar

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

  • Custom User Avatar

    You're getting NaN because your function doesn't work with the tests. The tests are going to call your function stairsIn20(number) and the tests are going to pass that function one argument: an array of arrays. Ultimately, what is happening is that you are trying to return stairs, which you have already defined, multiplied by number, but in this case, number is actually the array of arrays that the tests have passed to your function. An array * integer results in NaN.

    I think you may want to read the description again, because based on your code, it seems to me that you think the tests will pass a number of years to your function which you then have to return as the x-year estimate based on the number of steps in the example. The goal is to always produce a 20-year estimate of the number of steps taken, and every individual test will pass a different amount of steps in the form of an array containing a different array for each day of the week as an argument to your function.