Tell us what’s happening:
I cant manage to get everything to pass, how do I nest them all in one?
convertToInteger
should use the parseInt()
function
Passed
convertToInteger("56")
should return a number
Passed
convertToInteger("56")
should return 56
convertToInteger("77")
should return 77
convertToInteger("JamesBond")
should return NaN
Your code so far
function convertToInteger(str) {
var a = parseInt("56");
return a;
}
convertToInteger("56");
Your browser information:
User Agent is: Mozilla/5.0 (Linux; Android 8.0.0; SM-T820) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.105 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/use-the-parseint-function