docs(jsdoc): Document union nullable types

ExE Boss 2019-04-07 07:30:00 +02:00
Родитель 17cf2c6fab
Коммит 78401a4665
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: BF4FA5DD733D8D1A
1 изменённых файлов: 12 добавлений и 2 удалений

@ -490,12 +490,22 @@ Nullable types only have meaning if `strictNullChecks` is on:
```js
/**
* @type {?number}
* With strictNullChecks: true -- number | null
* With strictNullChecks: off -- number
* With strictNullChecks: true -- number | null
* With strictNullChecks: false -- number
*/
var nullable;
```
You can also use a union type:
```js
/**
* @type {number | null}
* With strictNullChecks: true -- number | null
* With strictNullChecks: false -- number
*/
var unionNullable;
```
Non-nullable types have no meaning and are treated just as their original type:
```js