字串是用引號包裹的,表示語言文字,
用雙引號包裹的都是字串
console.log(typeof 5); // number
console.log(typeof "5"); // String
注意:變數不能包裹在雙引號里
<!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>
</head>
<body>
<script>
console.log(typeof 5); // number
console.log(typeof "5"); // String
var a = 10;
console.log("a"); //輸出字母a
</script>
</body>
</html>輸出

布爾型別
true和false
注意都是小寫
console.log(4 > 3);console.log(8 > 13);![]()
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/471815.html
標籤:其他
上一篇:高級前端進階(五)
