请问,parseInt使用时,放在赋值位置和放在打印位置有什么区别吗?
来源:3-12 JavaScript数据类型之数值转换
小悟空tron
2018-03-13 04:17:02
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <script type="text/javascript"> var coffee=parseInt("21"); console.log(coffee); /*分割线。。。。。。。。。。。。。。。。。。。。。。。。*/ var coffee="21"; console.log(parseInt(coffee)); </script> </body> </html>
1回答
没什么区别,都可以的。
相似问题