JavaScript操作数和运算符简介

Operands and operators are the fundamental building blocks of JavaScript (and by association, most programming languages). Used together, they form expressions, the basic computing unit. While the names may sound technical and intimidating, they’re really not:

操作数和运算符是JavaScript (以及大多数编程语言的关联)的基本构建块。 一起使用,它们形成表达式,即基本计算单元。 尽管这些名称听起来听起来像是技术性的和令人生畏的,但实际上并非如此:

Operators are the verbs of JavaScript: they are symbols that allow operations, such as addition and subtraction, to take place. Some operators are words, but most are the symbols you’re already familiar with from learning math as a child. Others are more complex, or combinations of symbols, which we’ll get to presently.

运算符是JavaScript的动词 :它们是允许进行加减运算的符号。 一些运算符是单词,但是大多数是您从小就学习数学就已经熟悉的符号。 其他的比较复杂,或者符号的组合,我们现在将介绍。

Operands are the things that are acted upon by operators. They are typically positioned either side of an operand to form an expression. For this reason, you’ll sometimes hear them referred to as “left-hand operands” (or “left operand”) and “right-hand operands” (or “right operand”), describing their position in the expression. For example:

操作数操作员执行的操作 。 它们通常位于操作数的两侧以形成表达式 。 因此,您有时会听到它们被称为“左操作数”(或“左操作数”)和“右手操作数”(或“右操作数”)的情况,描述了它们在表达式中的位置。 例如:

var x = 5;

In this case, the equals sign is an operator, and the x and 5 are operands (the left and right-hand operands, respectively. Of course, x also signifies a variable in this instance). Taken together, they form an expression.

在这种情况下,等号是一个运算符x5操作数 (分别为左侧和右侧操作数。当然,在这种情况下, x也表示一个变量 )。 它们共同构成一种表达

Operators can do many things to operands: compare them, increment them, decrement them, divide them, and more. Conventionally, they are grouped together as arithmetic operators, bitwise operators, assignment operators, increment operators, comparison operators and logical operators, along with a collection of others. Each of them will be covered as separate entries in this reading list.

运算符可以对操作数做很多事情:比较它们,增加它们,减少它们,除它们等等。 按照惯例,它们被分组为算术运算符,按位运算符,赋值运算符,增量运算符,比较运算符和逻辑运算符,以及其他运算符的集合。 在本阅读清单中,它们每个都将作为单独的条目进行介绍。

翻译自: https://thenewcode.com/1036/Introduction-to-JavaScript-Operands-and-Operators

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值