mirror of
https://github.com/microsoft/frontend-bootcamp.git
synced 2026-01-26 14:56:42 +08:00
js var type changes
This commit is contained in:
@@ -25,10 +25,10 @@ We can create a new variable with the keywords `var`, `let`, `const` and use the
|
|||||||
|
|
||||||
- **boolean**: `true`, `false`
|
- **boolean**: `true`, `false`
|
||||||
- **number**: `1`, `3.14`
|
- **number**: `1`, `3.14`
|
||||||
- **string**: can use `'single quotes'`, `"double quotes"`, or `` `backticks` ``
|
- **string**: `'single quotes'`, `"double quotes"`, or `` `backticks` ``
|
||||||
- **array**: `[1, 2, 3]`
|
- **array**: `[ 1, 2, 3, 'hello', 'world']`
|
||||||
- **object**: defined inline (`{ foo: 3, bar: 'hello' })` or constructed (`new Foo()`)
|
- **object**: `{ foo: 3, bar: 'hello' }`
|
||||||
- **function**
|
- **function**: `function(foo) { return foo + 1 }`
|
||||||
- **null**
|
- **null**
|
||||||
- **undefined**
|
- **undefined**
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user