9、检测数据类型

yu
yu
2024-10-04 / 0 评论 / 4 阅读 / 正在检测是否收录...
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var a = 100 
        console.log(typeof a) //转成数值
        
        console.log(typeof(a))
            // 结果一定是字符串,string类型
        console.log(typeof typeof a)

        console.log(typeof a + 100)
        console.log(typeof (a + 100))
    </script>
</head>
<body>
     
</body>
</html>
0

评论 (0)

取消