From c9af4a4aac614751b9fbaddf21535f63fe07594b Mon Sep 17 00:00:00 2001 From: Michal Kopanski Date: Sat, 19 Oct 2019 15:57:06 -0400 Subject: [PATCH] Fix typo in "Null vs. Undefined" section "can save of storage and transmission costs" > "can save on storage and transmission costs" --- docs/javascript/null-undefined.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/javascript/null-undefined.md b/docs/javascript/null-undefined.md index 1e82f6b26..26338d300 100644 --- a/docs/javascript/null-undefined.md +++ b/docs/javascript/null-undefined.md @@ -119,7 +119,7 @@ JSON.stringify({willStay: null, willBeGone: undefined}); // {"willStay":null} As a result, JSON-based databases may support `null` values but not `undefined` values. Since attributes set to `null` are encoded, you can transmit the intent to clear an attribute by setting its value to `null` before encoding and transmitting the object to a remote store. -Setting attribute values to undefined can save of storage and transmission costs, as the attribute names will not be encoded. However, this can complicate the semantics of clearing values vs. absent values. +Setting attribute values to undefined can save on storage and transmission costs, as the attribute names will not be encoded. However, this can complicate the semantics of clearing values vs. absent values. ### Final thoughts TypeScript team doesn't use `null` : [TypeScript coding guidelines](https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines#null-and-undefined) and it hasn't caused any problems. Douglas Crockford thinks [`null` is a bad idea](https://www.youtube.com/watch?v=PSGEjv3Tqo0&feature=youtu.be&t=9m21s) and we should all just use `undefined`.