Skip to content

Commit

Permalink
Fix error in the code snippet for Symbol (#33765)
Browse files Browse the repository at this point in the history
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"
  • Loading branch information
chohanbin committed May 27, 2024
1 parent 32238d6 commit de65135
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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")}}:
Expand Down

0 comments on commit de65135

Please sign in to comment.