From 7dc2a3c79d2ea763a78de859dd2266089232bab3 Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Fri, 15 Apr 2022 08:05:10 +0300 Subject: [PATCH] minor fixes --- 1-js/04-object-basics/08-symbol/article.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/1-js/04-object-basics/08-symbol/article.md b/1-js/04-object-basics/08-symbol/article.md index 62b2cdf3..d071f651 100644 --- a/1-js/04-object-basics/08-symbol/article.md +++ b/1-js/04-object-basics/08-symbol/article.md @@ -1,11 +1,13 @@ # Symbol type -By specification, object property keys may be either of two primitive types: +By specification, only two primitive types may serve as object property keys: - string type, or - symbol type. +Otherwise, if one uses another type, such as number, it's autoconverted to string. So that `obj[1]` is the same as `obj["1"]` and `obj[true]` is the same as `obj["true"]`. + Till now we've been using only strings. Now let's explore symbols, see what they can do good for us.