Read about javascript string concatenation operator, The latest news, videos, and discussion topics about javascript string concatenation operator from alibabacloud.com
Speaking of operators, basically all kinds of programming languages are involved, the use of a similar way. Here is a simple collation of JavaScript here today.In general, operators are more than the comparison, can be divided into the following types:
Unary operators
Bitwise operators
Boolean operator
Multiplicative operators
Additive operators
Relational operators
Equal-se
predecessor operator accumulates or decrements and then assigns the value, and if it is the post operator, it is first assigned to add or subtract. (2) addition and subtraction operators used to take positive or negative operations, as well as to convert numeric strings to numeric forms.
var box = ";
" document.write (typeof box+ "
Ii. arithmetic operatorsThe
JavaScript false values and operators. If you want to learn about JavaScript, you can check them.
JavaScriptThe list of false values is as follows,
Value
Type
0
Number
NaN (Non-numeric)
Number
''(Null String)
String
False
Boolean
The following table lists the JavaScript operators, sorted from highest to lowest in order of precedence.operators that have the same precedence are evaluated in order from left to right.
Operator
Description
. [ ] ( )
field access, array index, function call, and expression grouping
++ -- - ~ ! Delete new typeof void
Unary operators, return data typ
$. Each traverses the JSON string and Uncaught TypeError: Cannot use 'in' operator to search for '156 error, jsonuncaught
Currently, webpage and backend interactions are popular. json is used to record the method for parsing strings. Do not forget it all the time !!!!
Success: function (data) {// data is a string passed in the background $. each (JSON. parse (d
specific type, in the following operator rule table, before the arrow is the type of the operator operand, and the type of the result of the operation after the arrow"Left value"An lvalue (Lvalue) is an ancient term that indicates that an expression can only appear to the left of the operatorIn JavaScript, variables, object properties, and array elements are bot
When you write JavaScript, you encounter a common question, "How can I tell if a value is an element in an array"? This reminds me of the In_array () function in PHP and the in operator in Python. But JavaScript does not seem to have a similar function built into it, and its in operator has a slightly different effect.
same will not say.
If the two numbers that are compared are strings, the string encoding values corresponding to the strings are compared.
Addition operations
The implicit conversion of the additive operation, I finally said, is because the addition of the implicit conversion and before the same, all the previous operation symbols, as long as one is a number, and the other by default using number () for digital conversion. The addition operation i
Some "strange" statements, such as {code...}, are often seen in online or interview questions ...} in Javascript, The + operator is an overload operator. It can be used to splice strings and add two "Numbers. In which case it depends on the types of parameters on both sides of the operator. In our daily development, we
One, the conditional operator (?:) The conditional operator is the only ternary operator in JavaScript, sometimes called a "ternary character". Usually this operator is written as "?:" and certainly not in the code, because the operator
Introduction to the instanceof operator
In JavaScript, to judge the type of a variable to try the typeof operator, it is a problem to store a value using a reference type when using the TypeOf operator, regardless of what type of object is referenced, it returns "Object". ECMAScript introduced another Java
javascript: operator
In fact, the operator if you have a computer language base should know, perhaps even more proficient than I am, so I do not explain more, to say a few other unfamiliar bar!
1. In operator: The in operator requires that the operand on the left is a
(RESULT1);//true
alert (RESULT2); False "55" is a string, 55 is a number, the type is not the same
Five, conditional operator
variable = conditional expression? True truth: False value
The conditional expression is evaluated first, and if the result is true, the truth is assigned to the variable, and if False, the false value is assigned to the variable.
Copy Code code as follows:
;
' ToString ' in sayhelloobj; True
' ToString ' in SayHello; Type error
' ToString ' in Numobj;//true
' ToString ' in num;//type error
The reason for this is that the introduction of string objects and literal conversions in MDN seems to explain this reason:
Because JavaScript automatically converts between string primitives and
Reader friends Good, I already have a general understanding of the role of JavaScript and some basic function declarations and variable declarations, today we will continue to explain the previous content, we will look at the logic of Javscript (positive sequence, Branch, loop) and some simple operators
Now let's talk about some simple operator operators
+ Plus: 1. Used to calculate two numbers plus
reason is that the following figure shows an introduction to String object and word volume conversion in MDN, which can be explained as follows:Because JavaScript automatically converts between string primitives and String objects, you can call any of the methods of the String
incorrect.
The reason is that the following figure shows an introduction to String object and word volume conversion in MDN, which can be explained as follows:
Because JavaScript automatically converts between string primitives and String objects, you can call any of the methods of the
); true4 //false "55" is a string, 55 is a number, the type is differentV. Conditional operatorsvariable = conditional expression? Truth value: false valuesThe conditional expression is evaluated first, and if the result is true, the truth is assigned to the variable, and if False, the value is assigned to the variable.1 Six, assignment operators1. Simple assignment Operator: =var num1 = ten; num=
. Adding the ! Operator gives us the only TRUE.When do I special case?A lot of times in JavaScript string manipulation, which is required to search for a particular character in a string. For example,1 var str = ' posterous '; 2 3 if (Str.search (' t ') >= 0 ) {4// character T found5} 6 Else {7// not found8 }We can u
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.