I\'m always confused when I hear strings are primitives in JS, because everybody knows that string has different methods like: length, indexOf, search etc.
Strings are not objects, they are native types, like numbers, but if you want to access the method on it they are boxed with String object. The same happen with numbers you can call (10).toString() but in fact you're calling toString on Number instance that wraps 10, when you call the method.