To convert a string into an integer, you can only use parseInt(str) to parse the string into an integer, which is decimal by default, octal if it starts with 0, and hexadecimal if it starts with 0x. Or parseInt
(str, radix) parses a string into integers according to the specified radix, that is, translates str into decimal as radix.