markdown 运营商

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 运营商相关的知识,希望对你有一定的参考价值。

# Operators
* `operator` - `+, -, *, /` Etc.
* `operand` - Is another name for arguments that operators are applied to. Example: `8 + 8`. 8 is called the `operand`.
* `unary` - An operator is `unary` if it has a single `operand`. Example: `-x`.
* `binary` - When we have two operands. Example: `8 + 8` or `"my" + "string"`
* `+` - This will convert any string or non string into a string. Example: `1 + '2'` // `12`.
  * A `unary` plus with convert to a number. Example: `+true` // `1`. Shorthand for `Number()`
* Operators have a precedence, means what happens first. Like math, read left to right, multiplication happens before addition.
* `%` - Remainder. Example: `5 % 2` // `1`.
* `**` - Exponentiation. Example `2 ** 3` // 8 ( 2 * 2 * 2)
* `++` - postfix `x++` or prefix `++x`. This operator works only on variables.
* `--` - postfix `x--` or prefix `--x`. This operator works only on variables.
  * Example: `let counter = 1; let a = counter++; // alert(a);` // 1
  * Example: `let counter = 0; alert( ++counter );` // 1
  * Notice on usage of incrementing we use prefix.
* Bitwise Operators - These are not commonly used or specific to JS. `&, |, ^, ~, <<, >>, >>>`
* Modify in place - `+=, -=, *=` Etc.
* `,` Example: `let a = (1 + 2, 3 + 4);` // a = 7. The first expression is evaluated then thrown away before the comma.

## Logical
* AND `&&`, OR `||`, NOT `!`

### AND
* Returns true if all are true.
* Finds the first false value and return.
* If all are true, return the last operand.

```js
true && true // true
false && true // false
true && false // false
false && false // false
```

### OR
* Finds the first truthy value.

```js
true || true // true
false || true // true
true || false // true
false || false // false
```

### NOT
* Converts operand to boolean and inverses it.
* The double !! converts a value to boolean then inverse again.

```js
!true // false
!false // true
!!'string' // true. This is the same as using: Boolean('string')
```

以上是关于markdown 运营商的主要内容,如果未能解决你的问题,请参考以下文章

markdown SASS'&'运营商

markdown Google搜索运营商 - 来源:https://ahrefs.com/blog/google-advanced-search-operators/

图片上传存储获得外链方法

苹果手机怎么设置不显示运营商名称?

防运营商劫持代码

android 判断是不是有sim卡及运营商