Basic JavaScript - Use the parseInt Function

Tell us what’s happening:
Describe your issue in detail here.


I have already passed the test and figured out what the answer is, but I have a question. What is going on with convertToInteger(“56”); ?

Also how would this be console.logged?

Your code so far

function convertToInteger(str) {


Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0

Challenge: Basic JavaScript - Use the parseInt Function

Link to the challenge:

That line calls the function named convertToInteger with the argument “56”. Your job is to make that function.

1 Like

Thanks for the hasty reply. I seem to have missed that the function was already declaring convertToInteger and I was expecting a var or a let or a const.

Any clue has to how this would be console.log? Or would that be giving away to much?

You can log anything by putting it inside the log function.


I see I was adding console.log(convertToInteger(str));

which was returning me with a str not defined message in the console. I got the console to work now. Thank you for your time and help.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.