Javascirpt It is a basic browser , object-oriented , event-driven Web scripting language developed by Netscape.
JS: object- based, objects include methods and Properties. no direct contact with Java
code writing: outside the chain, embedded, inline (JS code can be written anywhere in the HTML, but the code is run sequentially, usually JS written in bady or)HTML after the Label. Such as: code written in the head , the code cannot read the body Tag)
<scripttype= "text/javascript" >
Writing code
</script>
Format of Comments:
single-line Comments (//) and multiline comments (/* content */)
Declaring variables:
format:
var variable Name = value ;
Variable type:
String: as long as it is quoted characters, they are String, such as:"nihao123"
Number: integer (int) with decimal (float), NaN(it is a numeric type but it is not a count )
Boolean:true/false
Undefined: undefined type, When a variable is declared but not assigned a value .
Null: The value of the null type is only one / or will occur at the time of the Error:
cast:
If you convert a string to a Boolean type : false except "" ("space" This will show True) the others will be True.
numeric data converted to Boolean: 0=== "false 1===" True
Null and undefined will be converted to false
when converting other data types to numeric type: If you can convert it. you'll get a specific number. , but if you can't convert it. you'll Get NaN
As follows:
True 1
False 0
Null 0
Undefined NaN
"numeric character" NaN
"character number" NaN
"number" Digital
Basic JavaScript Learning