JavaScript for C#Developers Study(1)
JavaScript Basics
-
Special number values
Note:
- 10/0 doesn’t throw exception, it returns NaN instead
- NaN doesn’t equal to NaN
- use isNaN function to test NaN
- isNaN will coalesce string of number
-
Flow-control statements apply coalescing to boolean
In logical expression, the following values will be treated as false:
- empty string
- number 0
- NaN
- null
- undefined
Otherwise, true
For example, we don’t need to write if(a == null) to test, instead, we simply write if(a)
-
Reference Types
-
- Object Literals
-
- Array Literals
-
- Array is an Untyped collection which can hold different type of object inside of it
-
Function is a type like Func<> in c#, it can be assigned to a variable.








浙公网安备 33010602011771号