话说前端25,JavaScript的数据类型
分享兴趣,传播快乐,增长见闻,留下美好!
亲爱的您,这里是LearningYard新学苑。
今天小编为大家带来知识集|物流运输与配送管理(25),欢迎您的访问。
Share interests, spread happiness, increase knowledge, and leave a good legacy!
Dear you, this is The LearningYard Academy.
Today Xiaobian brings you the knowledge sharing of Knowledge Set| Logistics Transportation and Distribution Management (4), welcome to your visit.
Today, let"s talk about six types of Javascript. Javascript is a language with weak variables. When we define a variable, we don"t pay attention to its type. The data types of JavaScript language are composed of six types: string type, number type, Boolean type, null type, undefined type and object type. The first five types are basic data types, followed by extended data types. Next, the functions and usage of each data type are introduced in detail.
今天我们讲一下Javascript六大类型,Javascript是一个弱变量的语言,当我们定义一个变量的时候会不注重他的类型JavaScript语言的数据类型由字符串型、数字型、布尔型、null型、undefined型和对象型6大类型组成,前面5种为基本数据类型,后面扩展的数据类型,接下来详细地介绍每种数据类型的功能和使用方法。
Today, let"s talk about six types of Javascript. Javascript is a language with weak variables. When we define a variable, we don"t pay attention to its type. The data types of JavaScript language are composed of six types: string type, number type, Boolean type, null type, undefined type and object type. The first five types are basic data types, followed by extended data types. Next, the functions and usage of each data type are introduced in detail.
字符串是用Unicode字符、数字、标点符号等组成的的唯一序列,在JavaScript代码之中则用于表示JavaScript数据类型,字符串由单引号或双引号包裹,双引号定界的字符串中可以再包含单引号,单引号定界的字符串中也可以再包含双引号。
A string is a unique sequence composed of Unicode characters, numbers, punctuation marks, etc. In JavaScript code, it is used to indicate JavaScript data type. The string is wrapped by single quotation marks or double quotation marks. The string delimited by double quotation marks can contain single quotation marks again, and the string delimited by single quotation marks can also contain double quotation marks again.
在JavaScript代码中,数字型变量用的非常广泛,它也是最为基本类型,但它与其他语言的数字类型不同,它并不区别整数型和浮点型,而是统称为浮点型,这种类型既可以表示整数,小数,同时还能使用指数形式可以表示更大或更小的值。
In JavaScript code, numeric variable is widely used, and it is also the most basic type. However, it is different from numeric types in other languages. It does not distinguish between integer type and floating point type, but is collectively called floating point type. This type can represent both integers and decimals, and can also represent larger or smaller values in exponential form.
与数字类型不同,布尔型变量的值只有固定两种表示,一种是true,另一种是false,前者真,后者假,如果用数字表示,那么,true用1来表示,false用0来表示,布尔型值来源于逻辑性运算符,常用于控制流程。
Different from numeric types, there are only two fixed representations of the value of Boolean variables, one is true, the other is false, the former is true and the latter is false. If it is represented by numbers, then, true is represented by 1, and false is represented by 0. Boolean values are derived from logical operators and are often used in control processes.
在JavaScript代码中,空值型是特殊类型,它只有一个值,就是null,当引用一个未定义对象时,将返回一个null,严格意义上来说,null本质上是一个对象类型,是一个空指针对象类型。
In JavaScript code, null type is a special type. It has only one value, which is null. When an undefined object is referenced, it will return a null. Strictly speaking, null is essentially an object type and a null pointer object type.
与Null相同,Undefined也是只有一个undefined值,在编写JavaScript代码时,如果定义了一个变量,没有给它赋值,那么,这个变量返回undefined值,这也是变量默认的,与Null型不同之处在于,Null是一个空值,而Undefined表示无值。
Same as Null, Undefined has only one Undefined value. When writing JavaScript code, if a variable is defined and it is not assigned a value, then, this variable returns an undefined value, which is also the default of the variable. The difference from Null is that Null is a null value, while undefined means no value.
今天的分享就到这里了。如果您对今天的文章有什么独特的想法,欢迎评论留言,让我们相约明天,祝您今天过得开心快乐!
That"s it for today"s sharing. If you have any unique ideas for today"s article, please leave a comment, let us meet tomorrow, I wish you a happy day!
翻译:Google翻译
本文由LearningYard新学苑原创,部分图片文字来自网络,如有侵权请联系。
文字&排版|李仕阳
审核|李焕
2700元左右,目前这4款高性价比的手机,款款都不让人失望您在阅读前请点击上面的关注二字,后续会第一时间为您提供更多有价值的相关内容,感谢您的支持。现在手机的性能有了很大的提升,两三千元就可以购买到超高性能的手机,运行流畅,毫无卡顿,目前
谷歌手机三星造,以及背后更深层次的逻辑近日,谷歌方面刚刚发布了他们2022年第四季度的财报。其中显示,智能手机业务成为了谷歌这个季度相当亮眼的盈利点之一。就拿目前在售的Pixel7系列来说,一经推出就带动了谷歌的硬件销
联盟黑幕哈登惨招和谐北京时间2月11日,NBA官方宣布,莫兰特顶替库里,马尔卡宁顶替锡安,恩比德顶替杜兰特进入全明星先发阵容。随后替补进入全明星阵容的球员也出炉,分别是爱德华兹福克斯西亚卡姆。西亚卡姆
肠道不好危害大!中医清肠有三法,快试一试工作繁忙,每天三餐不定,赶上节假日,改善生活时还免不了暴饮暴食。不规律的进食习惯让很多人的肠胃出了故障,便秘的人比比皆是。其实,长期便秘,容易肥胖体臭,产生消化道疾病,脏腑功能也会
你以为詹姆斯只会打篮球?他收藏的百达翡丽价值4000万人民币!2023年2月8日,勒布朗詹姆斯荣登NBA历史得分王,你以为他只会打篮球?其实詹姆斯更是豪车,名表的收藏家!今天老魏整理十款老詹经常佩戴的腕表,看看NBA顶级球员的穿搭有多豪!与前
自驾电动车回家过年不敢开空调,充电就像开盲盒电动车主几乎都有电量焦虑症。为了省电,不少电动车主不敢开空调。(农健图)高速公路上飞驶的汽车中,绿牌照的新能源汽车越来越多。2023年春节期间,仅蔚来小鹏理想特斯拉等六家电动汽车品
S23全系骁龙实力比华为更雄厚的三星,做出的Exynos为什么那么烂文小伊评科技全球比较知名且有一定技术储备的移动芯片公司一个手都能数的过来高通,苹果,华为海思,联发科,三星(可以再加上紫光展讯)。各家芯片而三星又非常特殊,因为他是这几个芯片公司中
留给后代的可能不是鲁迅,而是机器人?随着chatGPT在世界范围内的爆火,引发了人们新一轮的担忧。首先我们普通人不太明白,到底什么是chatGTP人工智能。通俗易懂的说,它是一个可以在互联网不断学习知识,不断成长为逻
Nature在过去的三个世纪里,全球湿地大面积丧失长期以来,人类一直从湿地抽取水资源,这严重影响了陆地的水储量质量和供应蒸发陆地到海洋的碳输出碳平衡氧化亚氮和甲烷的排放营养物质的清除洪水制度和地下水补给以及生物多样性等生态系统功能
华为手表WhachGTCyber华为这次发布的可拆卸式手表WatchGTCyber,现在的潮流是非常多样化的,怎么跟上或引领现在的潮流是现在各大企业一直在思考的问题。潮流是一种态度,个性的彰显往往体现在细节上。针
Python数据获取初识Requests谈及到Python爬虫,必不可少的就是requests模块。前面内容中我们也讲到Python有丰富多彩的第三方模块,那么requests就是其中一个,requests模块是一个常用