I looked through all the questions and answers on stackoverflow, but could not find a simple answer to this question.
What is the difference between a string and an object?
For example, if I have this code:
var a = 'Tim'; var b = new String('Tim');
What is the difference?
I understand that new complicates the code, and new String slows it down.
In addition, I understand that a==b is true , but more strictly a===b is false . Why?
I don't seem to understand the process of creating an object and a string. For instance:
var a = new String ('Tim'); var b = new String ('Tim');
a==b false
source share