I was trying to create string data-types variables with values in 2 ways.
- As string-literal
- Using New Keyword
But to me it seems that these both are different in representation on console.log. Can someone tell me if 2nd way doesn't return string or is it someway different?
var str1 = "abc";
var str2 = new String("def");
console.log(str1);
console.log(str2);
Expected:
abc, def
Output: