Skip to content

Commit 442935c

Browse files
authored
Merge pull request lydiahallie#34 from bericp1/patch-1
Clarify Question 39
2 parents fa874f7 + b0d906d commit 442935c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,8 @@ JavaScript only has primitive types and objects.
11801180

11811181
Primitive types are `boolean`, `null`, `undefined`, `bigint`, `number`, `string`, and `symbol`.
11821182

1183+
What differentiates a primitive from an object is that primitives do not have any properties or methods; however, you'll note that `'foo'.toUpperCase()` evaluates to `'FOO'` and does not result in a `TypeError`. This is because when you try to access a property or method on a primitive like a string, JavaScript will implicity wrap the object using one of the wrapper classes, i.e. `String`, and then immediately discard the wrapper after the expression evaluates. All primitives except for `null` and `undefined` exhibit this behaviour.
1184+
11831185
</p>
11841186
</details>
11851187

0 commit comments

Comments
 (0)