Challenge Cash Register

Hello, I really need help with the following code. When I run the code on chrome console or in any other javascript online tool I get the correct return object. But freecodecamp wont give me pass for the 2nd and 3rd test. Working for hours I couldnt find the mistake. Thank you in advance

Find it thank you. I had declared table as a global variable