From 7b535f9419ae01594c5c2e35ce1e56eca3082846 Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Fri, 8 Aug 2014 18:13:28 -0400 Subject: [PATCH] add docs for nullables --- docs/how-to-read-signatures.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/how-to-read-signatures.md b/docs/how-to-read-signatures.md index 785bb6c6..fc794466 100644 --- a/docs/how-to-read-signatures.md +++ b/docs/how-to-read-signatures.md @@ -164,3 +164,13 @@ void test(Object { any | void config(DOMElement) } value) //example of a valid function call 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`