贫困生出钱请领导,省港旗兵4,汤宝如个人资料
数据类型包括:基本数据类型和引用数据类型
基本数据类型指的是简单的数据段,引用数据类型指的是有多个值构成的对象。
当我们把变量赋值给一个变量时,解析器首先要确认的就是这个值是基本类型值还是引用类型值
1.number
1 <!doctype html> 2 <html lang="en"> 3 <head> 4 <meta charset="utf-8"> 5 <title>流浪者</title> 6 <style> 7 div{ 8 font-size: 40px; 9 font-weight: bold; 10 font-family: "华文行楷"; 11 } 12 </style> 13 14 </head> 15 <body> 16 17 <script> 18 var a = 1; 19 console.log(typeof a); 20 var b = 5/0; 21 console.log(b); 22 console.log(typeof b); 23 </script> 24 25 <div>流浪者流浪者</div> 26 27 </body> 28 </html>
2.string
1 <!doctype html> 2 <html lang="en"> 3 <head> 4 <meta charset="utf-8"> 5 <title>流浪者</title> 6 <style> 7 div{ 8 font-size: 40px; 9 font-weight: bold; 10 font-family: "华文行楷"; 11 } 12 </style> 13 14 </head> 15 <body> 16 17 <script> 18 var str = '123'; 19 console.log(typeof str); 20 </script> 21 22 <div>流浪者流浪者</div> 23 24 </body> 25 </html>
3.boolean
1 <!doctype html> 2 <html lang="en"> 3 <head> 4 <meta charset="utf-8"> 5 <title>流浪者</title> 6 <style> 7 div{ 8 font-size: 40px; 9 font-weight: bold; 10 font-family: "华文行楷"; 11 } 12 </style> 13 14 </head> 15 <body> 16 17 <script> 18 var b = false; 19 console.log(typeof b); 20 </script> 21 22 <div>流浪者流浪者</div> 23 24 </body> 25 </html>
4.null
1 <!doctype html> 2 <html lang="en"> 3 <head> 4 <meta charset="utf-8"> 5 <title>流浪者</title> 6 <style> 7 div{ 8 font-size: 40px; 9 font-weight: bold; 10 font-family: "华文行楷"; 11 } 12 </style> 13 14 </head> 15 <body> 16 17 <script> 18 var c = null; 19 console.log(typeof c); 20 </script> 21 22 <div>流浪者流浪者</div> 23 24 </body> 25 </html>
5.undefined
1 <!doctype html> 2 <html lang="en"> 3 <head> 4 <meta charset="utf-8"> 5 <title>流浪者</title> 6 <style> 7 div{ 8 font-size: 40px; 9 font-weight: bold; 10 font-family: "华文行楷"; 11 } 12 </style> 13 14 </head> 15 <body> 16 17 <script> 18 var d; 19 console.log(typeof d); 20 </script> 21 22 <div>流浪者流浪者</div> 23 24 </body> 25 </html>
1.function
2.object
3.array
4.string
5.date
作者:流浪者
日期:2019-09-03
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Python爬虫:Request Payload和Form Data的简单区别说明
浅谈Python中threading join和setDaemon用法及区别说明
Python3-异步进程回调函数(callback())介绍
python继承threading.Thread实现有返回值的子类实例
Python中使用threading.Event协调线程的运行详解
网友评论