Use the parseInt Function Help

Use the parseInt Function Help
0

#1

Tell us what’s happening:

Your code so far


function convertToInteger(str) {
  
}

convertToInteger("56");

Your browser information:

User Agent is: Mozilla/5.0 (X11; CrOS x86_64 9765.81.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.120 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/use-the-parseint-function


#2

You need to put code inside the function called convertToInteger.

That function will receive an input that is a string, and you need to return a number.


#3

function convertToInteger(str) {

var a = parseInt()

return 56

}

like this…


#4

Not quiet. You gotta make it dynamic.

It would be something like

var a = parsetInt(str);

return a;

#5

or you could also directly return the value like

return parseInt(str);