I am writing an array calculator on code wars. I have a function that checks the array for a valid sequence of numbers and operators. My function validSequence() is not return false when it is supposed to. The error in this test array:
Test.assertSimilar(validSequence(['10', '+', '20', '*','3', '*']), false)
is not being caught by this line in validSequence()
if(typeof parseInt(arr[arr.length-1]) !== 'number'){
return false;
}
and I don't know why. It gives a NaN as expected, so I don't know why it doesn't enter the block and return false.