add docs for nullables
This commit is contained in:
parent
d81263f55e
commit
7b535f9419
1 changed files with 10 additions and 0 deletions
|
|
@ -164,3 +164,13 @@ void test(Object { any | void config(DOMElement) } value)
|
||||||
//example of a valid function call
|
//example of a valid function call
|
||||||
test({ first: "first", config: function(element) { /*do stuff*/ } })
|
test({ first: "first", config: function(element) { /*do stuff*/ } })
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Nullable Types
|
||||||
|
|
||||||
|
A question mark `?` after a type denotes that a value can be either of that type or `undefined`.
|
||||||
|
|
||||||
|
```clink
|
||||||
|
XMLHttpRequest? config()
|
||||||
|
```
|
||||||
|
|
||||||
|
In the example above, the `config` function is expected to return either an instance of the XMLHttpRequest object or `undefined`
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue