In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "what are the misunderstandings in the use of JavaScript". In the daily operation, I believe many people have doubts about the misunderstandings in the use of JavaScript. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the questions of "what are the misunderstandings in the use of JavaScript?" Next, please follow the editor to study!
The assignment operator was applied incorrectly.
In the JavaScript program, if you use the equal sign (=) of the assignment operator in the if conditional statement, it will produce an error result. The correct way is to use the two equal signs of the comparison operator (= =).
The assignment statement returns the value of the variable.
Common errors in comparison operators:
In regular comparisons, data types are ignored.
In a rigorous comparison operation, = = is the identity operator, while checking the value and type of the expression, the switch statement uses the identity operator (= =) for comparison.
Notes on addition and connection:
Addition is the addition of two numbers.
A connection is a connection of two strings.
JavaScript uses the "+" operator for addition and concatenation.
Considerations for the use of floating point data:
All data in JavaScript is stored as 64-bit floating point data (float).
Http://www.iis7.com/a/lm/yczmljgj/
All programming languages, including JavaScript, are difficult to determine the accuracy of floating-point data. It is solved by multiplication and division of integers.
AvaScript string Branch:
JavaScript allows us to use line breaks in strings, but using carriage return line feeds directly in strings will cause errors, and string breaks require a backslash (\).
Incorrect use of semicolons:
Pay attention to the use of semicolons.
Considerations for using return statements:
JavaScript ends automatically on the last line of code by default.
AvaScript can also use multiple lines to end a statement.
Note: there is no need to break the line of the return statement.
The array is indexed by name:
Many programming languages allow names to be used as indexes on arrays.
An array that uses a name as an index is called an associative array (or hash).
JavaScript does not support indexing arrays with names, only numeric indexes are allowed.
In JavaScript, objects use the name as the index.
If you use the name as the index, JavaScript redefines the array as a standard object when accessing the array.
After doing this, the methods and properties of the array can no longer be used, otherwise an error will occur:
Define array elements, and finally you cannot add a comma.
Define an object, and finally you cannot add a comma.
Undefined is not Null:
In JavaScript, null is used for objects and undefined for variables, properties, and methods.
The object can be null only if it is defined, otherwise it is undefined.
If we want to test whether the object exists, an error will be thrown when the object is not defined.
Block scope:
JavaScript does not create a new scope in each code block, and the scope of each code block is generally global.
At this point, the study of "what are the misunderstandings in the use of JavaScript" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.