Skip to content

Instantly share code, notes, and snippets.

@amysimmons
Created February 21, 2018 08:49
Show Gist options
  • Save amysimmons/9a4c8565b066a67e1f8a9615352c995c to your computer and use it in GitHub Desktop.
Save amysimmons/9a4c8565b066a67e1f8a9615352c995c to your computer and use it in GitHub Desktop.
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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment