Before I start, I want to throw a question, = = and = = What is the difference? Probably the average person will think, is not the latter in addition to comparing the value of equality will also compare the type is equal, what is good to ask, who do
One, data type
5 Basic types of data:null/undefined/string/boolean/number
1 kinds of complex data types:Object
Second, data type detection
A brief summary of several ways of detecting data types in JS and its advantages and disadvantages
1,
JavaScript is well known as a dynamic type, and the type conversion occurs in many cases by the weak type of the scripting language whose data type. These types of conversions are often implicit, which gives us a lot of trouble when using JS. And JS'
Two JavaScript basic syntaxA JavaScript Data types*****************************************************************Different programming languages tend to have different data classifications, unlike object-oriented languages such as C and Java,
The data type of JavaScript is very weak (otherwise it will not be called a weak-type language)! When using arithmetic operators, the data types on either side of the operator can be arbitrary, for example, a string can be added to a number. The
For JS this language, because it is a dynamic type language, the variable is no type, can be given any value at any time.However, the data itself and the various operations are typed, so the variable needs to be converted to the type of operation.In
: Network Disk DownloadContent Introduction· · · · · ·The return of the "JavaScript King" in your hands is not only a book of knowledge, but also a book for finding a way.This book is divided into five sections to discuss with readers the various
68 effective ways to write high-quality JS code (i)Get to know the JavaScript version you're usingTips:
Decide which versions of JavaScript your application supports.
Make sure that the features of any JavaScript you use are supported
variables [coercion] variables and functions must be defined before they are used.// goodvar name = ‘MyName‘;// badname = ‘MyName‘;[Force] Only one variable can be declared per var.Explain:A var declares multiple variables, which can lead to a
var New String ("abc"); Console.log (typeof// is an object, not a stringUse the new String ("abc"); The wrapper object for string ABC is created instead of the base type value "ABC".Encapsulating objectsBecause the base type value does not have.
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.