<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <script> var num=111; var str=num.toString(); console.log(str); console.log(typeof num); // 111数据类型 console.log(typeof str); //字符串类型 </script> </body> </html>