convertToInteger(“56”) should return a number
convertToInteger(“56”) should return 56
convertToInteger(“77”) should return 77
convertToInteger(“JamesBond”) should return NaN
At that I don’t understand the code that I should do?
I try convertTolnteger(“56”)
and of all them same with the code above but it isn’t right
You may need to start the Basic JavaScript section again and reset the code for each lesson. You seem to not understand some of the very first basics, so you will struggle very much through any later lessons until you can work through the first lessons without having to ask for help.
The problem in this section is that instead of var you should pay attention to this part here.
Use parseInt() in the convertToInteger function so it converts the input string str into an integer, and
returns it.
This changes the approach a bit. You shouldn’t be focusing on creating a var for the parseInt inside the function. But to return the parseInt inside the function. I got a bit confused there too and I understand what you meant.