(Use the parseInt Function)

(Use the parseInt Function)


Tell us what’s happening:
I don’t have understand what i should do

Your code so far

function convertToInteger(str) {


Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36.

Link to the challenge:


In the challenge example, do you understand that the following line converted the string “007” into the number 7 and assigned it to the variable a?

var a = parseInt("007");

If so, see if you can use the parseInt function on the argument passed into the function (str) and return the converted number.


Okay That I understand it the first is right now for others I don’t understand what to do


To which others are you referring?


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


Read my first reply carefully.

Do you understand what the str parameter represents in the function definition?

Do you understand that parseInt is a function which will attempt to convert any string passed to it into Integer value?

Do you understand how to return a value in a function?


I understand of all this but i don’t understand the last one.


I don’t understand the last sentence


Review the following lesson to understand how to return a value from a function.



I read it but again I don’t understand it sorry for tiredness but I don’t understand it


I believe it is easy but now I have many hours which I try to do it and mmy brain has got tired


You do not understand the lesson on how to return a value from a function? If so, which part of that lesson do you not understand?


I don’t understand it all I haven’t got a part of lesson!


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.