From de651354e8803fdbb19a2458a5f2f1ab939f3b95 Mon Sep 17 00:00:00 2001 From: Hanbin Cho Date: Sun, 26 May 2024 23:32:44 -0400 Subject: [PATCH] Fix error in the code snippet for Symbol (#33765) The written instruction above the snippet says "Note that Symbol("foo") does not coerce the string "foo" into a Symbol." but the code snippet illustrates "Symbol("foo") === Symbol("foo"); // false" The intention seemed to have been "Symbol("foo") === "foo"; // false" --- .../web/javascript/reference/global_objects/symbol/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/web/javascript/reference/global_objects/symbol/index.md b/files/en-us/web/javascript/reference/global_objects/symbol/index.md index ea993f6923876bf..29a2a7827332a68 100644 --- a/files/en-us/web/javascript/reference/global_objects/symbol/index.md +++ b/files/en-us/web/javascript/reference/global_objects/symbol/index.md @@ -24,7 +24,7 @@ const sym3 = Symbol("foo"); The above code creates three new Symbols. Note that `Symbol("foo")` does not coerce the string `"foo"` into a Symbol. It creates a new Symbol each time: ```js -Symbol("foo") === Symbol("foo"); // false +Symbol("foo") === "foo"; // false ``` The following syntax with the {{jsxref("Operators/new", "new")}} operator will throw a {{jsxref("TypeError")}}: