stuck on Update the second condition in your if statement to use the isNaN() function to check if the value returned by parseInt() is NaN .
got the first part of the question done by wrapping the parseInt() in the isNaN() but there is a second part that is stumping me:
You should wrap the value returned by parseInt() in the isNaN() function. And add a third condition which checks the value returned by parseInt() to be less than 0.
tried several solutions but they only focus on the wrapping element which i’ve done not the third condition.
You should wrap the value returned by parseInt() in the isNaN() function. And add a third condition which checks the value returned by parseInt() to be less than 0.
But in your attempt you only have 2 conditions?
(i understand that your attempts are not passing but we need to see your best attempt at this. That means, try to add that third condition to the best of your ability and understanding and show us that code)
I don’t currently have code in the box but I have tried variation of things like parseInt( < 0), parseInt(numberInput.value <0), parseInt(numberInput.value <= 0) and the like but nothing worked so I am stumped and all the videos and forums only reference the second condition not the third.
can you write out the whole line of code with your best attempt at this and post it in your reply? I just want to see what you’re thinking and the only way to see that is to see your code.
honestly i don’t know i’ve needed a lot of outside help with java compared to HTML and CSS but i can’t find anything that explains it well enough for me to understand the issue
not to needlessly correct you, but you are learning JavaScript right now, not Java.
To answer the question: what does the method parseInt take as an input, you have 2 choices.
1- look at previous steps and use some logic to figure out what type of value parseInt takes.
2- google it like this “MDN parseInt” and read the documentation.
ok so i checked my existing code and this is the first time using parseInt() so there is no previous example and the explanation in site and google made no sense whatsoever
i got step 11 easy but this is confusing - i am going to start the unit over since im only at step 12 and try to wrap my head around this - i will come back if i still don’t get it
unfortunately that friend may have prevented you from figuring this one out on your own.
Understanding how functions work is a basic skill that you will need.