can someone help me why my code is wrong
& it log NaN!!! …
price
is undefined so when multiplied by 0.06
, getTax becomes NaN
. Likewise, when price
is added, it is,
undefined + NaN
which again results in NaN
.
Define price (give it a value of 7.50) and this will not happen.
Without a link to the exact exercise it is difficult to say if any of your code is incorrect or not as directed. Please post a link.
thanks you so much
i just turn this (https://www.codecademy.com/courses/learn-javascript-functions/lessons/functions/exercises/return-ii?action=resume_content_item&course_redirect=introduction-to-javascript) in to my code …
i got what you said but why
on line 7 price didn’t get value!!
I’ll have to go over the instructions from the start because my code looks nothing like yours, and there is no price variable. The value is fixed in the getSubTotal
function. What lesson asks for the price
variable to begin with?
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.