Skip to content

Instantly share code, notes, and snippets.

@VladimirCores
Created November 21, 2020 09:29
Show Gist options
  • Save VladimirCores/15eb68b7f6b741cd5ead9f47517dbf73 to your computer and use it in GitHub Desktop.
Save VladimirCores/15eb68b7f6b741cd5ead9f47517dbf73 to your computer and use it in GitHub Desktop.
String value type and String object type
let st1 = new String('NAME')
let st2 = st1
let st3 = 'NAME'
console.log('st1 === st2 ->', st1 === st2)
console.log('st1 == st2 ->', st1 == st2)
console.log('st1 === st3 ->', st1 === st3)
console.log('st1 == st3 ->', st1 == st3)
console.log('st2 === st3 ->', st2 === st3)
console.log('st2 == st3 ->', st2 == st3)
console.log('======================')
console.log('st1 = NAME')
st1 = 'NAME'
console.log('======================')
console.log('st1 === st2 ->', st1 === st2)
console.log('st1 == st2 ->', st1 == st2)
console.log('st1 === st3 ->', st1 === st3)
console.log('st1 == st3 ->', st1 == st3)
console.log('st2 === st3 ->', st2 === st3)
console.log('st2 == st3 ->', st2 == st3)
console.log('======================')
console.log('st1, st2, st3:', st1, st2, st3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment