For strings, you have both
- primitive strings (the ones you manipulate most of the times, and that you get from literals)
- and instances of the
String
class.
And they're not the same.
Here's what the MDN says on the distinction between both.
Another way to see the difference, which the MDN doesn't point, is that you can add properties on objects :
var a = "a";
a.b = 3; // doesn't add the property to a but to a wrapped copy
console.log(a.b); // logs undefined
a = new String("a");
a.b = 3;
console.log(a.b); // logs 3
(remember that most of the times, you should use primitive strings)
For arrays, you only have arrays, there is nothing like a primitive array.