Last active
December 5, 2019 14:08
-
-
Save kumavis/cfec971e3224252f038a8ae575925b3e to your computer and use it in GitHub Desktop.
more javascript hijinks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> x = 'hello' | |
'hello' | |
> x.toString = () => 'ayy' | |
[Function] | |
> x.valueOf = () => 'yoo' | |
[Function] | |
> x | |
'hello' | |
> x+'' | |
'hello' | |
> String(x) | |
'hello' | |
> y = Object(x) | |
[String: 'hello'] | |
> y.valueOf = () => 'yoo' | |
[Function] | |
> y.toString = () => 'ayy' | |
[Function] | |
> y | |
{ [String: 'hello'] valueOf: [Function], toString: [Function] } | |
> y+'' | |
'yoo' | |
> String(y) | |
'ayy' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment