Using the ParseInt function

Using the ParseInt function
0

#1

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.


#2

Your function is returning what was passed in: str. I think you meant to return a instead.


#3

Simple as that. Thank you!