var a = "12"
var b = new String("12")
a // "12"
b // String {"12"}
a == b // true (a is compared with b's toPrimitive value)
// b's primitive value is obtained by calling toString()
b.toString() // "12"
Created
February 21, 2018 08:49
-
-
Save amysimmons/9a4c8565b066a67e1f8a9615352c995c to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment