Hi. I’m stuck on Use the ParseInt Function.
Here’s my code:
function convertToInteger(str)
{
var a = parseInt(str);
return str;
}
convertToInteger("56");
Thanks in advance for any help.
Hi. I’m stuck on Use the ParseInt Function.
Here’s my code:
function convertToInteger(str)
{
var a = parseInt(str);
return str;
}
convertToInteger("56");
Thanks in advance for any help.
Your function is returning what was passed in: str. I think you meant to return a instead.
Simple as that. Thank you!