Operator Precedence is an important point of knowledge that a programmer must understand and hold, let's take a look at the PHP operator precedence article.
Today in Lao Wang's technical manual saw a problem:
The code is as follows
If you have an expression like 2 + 3 * 4, do you do the addition first, or do the multiplication first? Our high school math tells us that we should do multiplication first-which means that the multiplication operator takes precedence over the
1 short circuit with &&, when the left is false, do not execute to the right;Short Circuit or | |, when its left is true, does not execute to the right.2 int a=1;if (a++==2) {A = 7;}System.out.println (a);The output is 2, because when + + is on the
Today in Lao Wang's technical handbook see a problem:
The code is as follows
Copy Code
What is the output?
This question may seem simple at first glance, but it is not easy to scrutinize it,
If the Boolean
Original location http://caibaojian.com/toutiao/54461. All variable declarations (VAR) or declared functions will be promoted to the top of the current functionWith regard to function expressions, JS splits the code into two lines of code to execute
An operator is a particular symbol or expression used to examine, modify, or merge variables. For example, with the sum operator + you can sum two digits (such as let i = 1 + 2); a slightly more complex example has logic and operator && (e.g. if
In the logical operator of PHP, XOR represents a logical XOR or
$a XOR $b
Results
Returns true if the $a and $b have and only one is true, or False if all are true or false.
However, when testing the XOR operator, a little problem was founderror
This table gives the operator precedence (from low to high) for Python.From the lowest priority (the most loosely combined) to the highest priority (the most tightly coupled).This means that in an expression, Python first calculates the following
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.