0
votes

I have problem with my code. This is function with 2 arguments (x, y). It work only if one of them is hardcoded like 0, 1.. but two variables are not readable for my computer.

            { Price.push(`${package[x].equipment[y].price.pow30}`)}

do not work, but the same code

            { Price.push(`${package[0].equipment[y].price.pow30}`)}
``` or
        { Price.push(`${package[x].equipment[0].price.pow30}`)}
will work good. I tried to return x || y, and it works. I even do simple maths with them, but something is missing when I try to return object. 
This is not a (properly formatted) minimal reproducible example - Andreas
What specifically "does not work" about it? In what specific way is it failing? Can you provide a minimal reproducible example which demonstrates the problem? - David
I guess it is obvious. It return just an NaN, instead of numbers. - Kasia Strzempek