1.在html中可以使用console.log 进行打印调试代码console.log 表示用console.
log终端下的log日志把数据打印出来
2.查看变量值中的数据类型 使用关键字 typeof
console.log(typeof str1): string 表示字符串
console.log(typeof num): number 表示数字
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script>
var str1 = '我是字符串'
var num = '123456'
var num1 = 100
console.log(typeof str1)
console.log(typeof num)
console.log(typeof num1)
</script>
</body>