Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use JavaScript operators, expressions, and keywords

Shulou Source: shulou.com Published: 2022-06-01 10:54:34 09月11日 Update

Most people do not understand the knowledge points of this article "JavaScript operators, expressions and keywords", so the editor summarizes the following contents, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "JavaScript operator, expression and keyword usage" article.

JavaScript uses the arithmetic operator (+-* /) to calculate the value:

(7 + 8) * 10

JavaScript uses the assignment operator (=) to assign a value to a variable:

Var x, y

Var x = 7

Var y = 8

JavaScript expression

An expression is a combination of values, variables, and operators, and the result is a value.

6 * 10

Expressions can also contain variable values:

X * 10

Values can be of many types, such as numeric values and strings.

For example, "Bill" + "+" Gates ", calculated as" Bill Gates ":

"Bill" + "+" Gates "

JavaScript keyword

The JavaScript keyword is used to identify the action being performed.

The var keyword tells the browser to create a new variable:

Var x = 7 + 8

Var y = x * 10

JavaScript comment

Not all JavaScript statements are executed.

The code between the double slash / / or / * and * / is considered a comment.

Comments are ignored and not executed:

Var x = 7; / / will execute

/ / var x = 8; will not execute

The above is the content of this article on "how to use JavaScript operators, expressions and keywords". I believe we all have some understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.

Tags: Key words expressions operators operations content usage methods variables comments articles knowledge articles between code values actions multiple most characters Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL OPPO Reno MariaDB Microsoft Xiaomi