Arithmetic Operators
算术运算符
加 x=2
y=2
x+y 4 - Subtraction
减 x=5
y=2
x-y 3 * Multiplication
乘 x=5
y=4
x*y 20 / Division
除 15/5
5/2 3
2.5 % Modulus (division remainder)
余数 5%2
10%8
10%2 1
2
0 ++ Increment
递增 x=5
x++ x=6 -- Decrement
递减 x=5
x-- x=4
Assignment Operators
赋值运算符
Comparison Operators
比较(关系)运算符
等于 5==8 returns false === is equal to (checks for both value and type)
等于(检查值和类型)*全吻合才算相等 x=5
y="5"
x==y returns true
x===y returns false
不等于 5!=8 returns true > is greater than
大于 5>8 returns false < is less than
小于 5<8 returns true >= is greater than or equal to
大于等于 5>=8 returns false <= is less than or equal to
小于等于 5<=8 returns true
Logical Operators
逻辑运算符
与 x=6
y=3
(x < 10 && y > 1) returns true
|| or或 x=6
y=3
(x==5 || y==5) returns false
! not非 x=6
y=3
!(x==y) returns true
String Operator
串符(连接作用)
A string is most often text, for example "Hello World!". To stick two or more string variables together, use the + operator.
在文字当中使用的比较多,举例来说“Hello World!”要将两个或多个字符串变量衔接在一起的话就得使用 + 符号
txt1="What a very" txt2="nice day!" txt3=txt1+txt2
The variable txt3 now contains "What a verynice day!".
txt3变量现在包含“What a verynice day!”(把1和2衔接起来了)
To add a space between two string variables, insert a space into the expression, OR in one of the strings.
要给两个字符串变量中间添加空格就得在表达式里插入空格,或在其中的一个加上(空格)
txt1="What a very" txt2="nice day!" txt3=txt1+" "+txt2
or
txt1="What a very " txt2="nice day!" txt3=txt1+txt2
The variable txt3 now contains "What a very nice day!".
现在变量txt3为“What a very nice day!”
Conditional Operator
条件运算符
JavaScript also contains a conditional operator that assigns a value to a variable based on some condition.
JS有根据条件不同给变量不同值的条件运算符
Syntax
语法
variablename=(condition)?value1:value2
Example
例子
greeting=(visitor=="PRES")?"Dear President ":"Dear "
If the variable visitor is equal to PRES, then put the string "Dear President " in the variable named greeting. If the variable visitor is not equal to PRES, then put the string "Dear " into the variable named greeting.
如果变量visitor的值等于PRES那么greeting的值就为"Dear President "。如果不为PRES那么greeting的值就为"Dear"
操作符
P70系列延期,华为新旗舰将在下月发布
3月20日消息,近期博主@数码闲聊站 透露,原定三月份发布的华为新旗舰P70系列延期发布,预计4月份上市。
而博主@定焦数码 爆料,华为的P70系列在定位上已经超过了Mate60,成为了重要的旗舰系列之一。它肩负着重返影像领域顶尖的使命。那么这次P70会带来哪些令人惊艳的创新呢?
根据目前爆料的消息来看,华为P70系列将推出三个版本,其中P70和P70 Pro采用了三角形的摄像头模组设计,而P70 Art则采用了与上一代P60 Art相似的不规则形状设计。这样的外观是否好看见仁见智,但辨识度绝对拉满。
更新动态
- 欢乐钓鱼大师最稀有的鱼是什么 欢乐钓鱼大师最稀有的鱼攻略
- ABC唱片-《蔡琴.三十周年纪念版》6N纯银镀膜[WAV+CUE]
- ABC唱片-《汉斯.德斯辛克.心中布鲁斯》6N纯银镀膜[WAV+CUE]
- 群星《DJ·夜色魅影HQ》头版限量[低速原抓WAV+CUE]
- 《如龙》桐生声优被警察拦下盘问:你有犯罪记录吗?
- 游族2023年净利润0.91亿元 《少年西游记2》即将公测
- 曝快手北京游戏事业部全数被裁 项目测试数据未达标
- 李雨寰.2012-我可是天使【有凰音乐】【WAV+CUE】
- 刘美君.1991-听我细诉【BMG】【WAV+CUE】
- 群星.2016-滚石爱情故事3CD【滚石】【WAV+CUE】
- 欢乐钓鱼大师怎么解锁全地图 欢乐钓鱼大师全地图解锁方法
- 欢乐钓鱼大师锦标赛在哪里进 欢乐钓鱼大师锦标赛入口位置介绍
- 欢乐钓鱼大师ios兑换码在哪 欢乐钓鱼大师ios兑换码介绍
- 蒋小雨《夜空的风HQ》头版限量编号[低速原抓WAV+CUE]
- [ABC]邓丽君-初恋的地方[6N纯银镀膜][正版CD低速原抓WAV+CUE]