Intermediate Algorithm Scripting - Everything Be True

Hello everyone, in my code below, I used:

1- parseInt() function to convert the string to an integer
2- i used 8 radix, and this is my problem, what has happened when i added 8 radix to the parseInt() function? What are the changes will it make to the number? Why did I get 365 in the console?

NOTE: // i don’t except any result, because i am still new to radix, i want to know what will the 8 radix do to the number. //

let myNationality = “555”;

console.log(parseInt(myNationality, 8));

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Safari/605.1.15

Challenge Information:

Intermediate Algorithm Scripting - Everything Be True

1 Like

Hello @bushra.ghames2707 !

8 radix means that a base 8 numeric system (octal) will be used instead of base 10.

Check out these great articles for examples.
parseInt() in JavaScript – JS String to Int Example

parseInt()

Does this help?
Keep up the good progress!

Happy Coding! :slightly_smiling_face:

1 Like

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