| 文章簡介:這裡我們提 null 的主要目的是為了說一點,如果我們定義一個變數,而這個變數未來是用於儲存物件的,此時,我們最好將這個變數初始化為 null ,這樣以來,只要檢測null 值就可以知道這個變數是否已經儲存了一個對象的引用了。 |
null 類型是第二個只有一個值的資料類型,它的值就是null ,null 值表示一個Null 物件指標,所以使用 typeof 操作符檢測null 的時候是一個對象。element
| Font |
| font-family |
|
| font-size |
|
| font-style |
|
| font-variant |
|
| font-weight |
|
| letter-spacing |
|
| line-height |
|
| text-decoration |
|
| text-align |
|
| text-indent |
|
| text-transform |
|
| white-space |
|
| word-spacing |
|
| color |
|
| Background |
| bg-attachment |
|
| bg-color |
|
| bg-image |
|
| bg-position |
|
| bg-repeat |
|
| Box |
| width |
|
| height |
|
| border-top |
|
| border-right |
|
| border-bottom |
|
| border-left |
|
| margin |
|
| padding |
|
| max-height |
|
| min-height |
|
| max-width |
|
| min-width |
|
| outline-color |
|
| outline-style |
|
| outline-width |
|
| Positioning |
| position |
|
| top |
|
| bottom |
|
| right |
|
| left |
|
| float |
|
| display |
|
| clear |
|
| z-index |
|
| List |
| list-style-image |
|
| list-style-type |
|
| list-style-position |
|
| Table |
| vertical-align |
|
| border-collapse |
|
| border-spacing |
|
| caption-side |
|
| empty-cells |
|
| table-layout |
|
| Effects |
| text-shadow |
|
| -webkit-box-shadow |
|
| border-radius |
|
| Other |
| overflow |
|
| cursor |
|
| visibility |
|
這裡我們提 null 的主要目的是為了說一點,如果我們定義一個變數,而這個變數未來是用於儲存物件的,此時,我們最好將這個變數初始化為 null ,這樣以來,只要檢測null 值就可以知道這個變數是否已經儲存了一個對象的引用了。var car = null;if(car != null){}