A very simple doubt about Objects

A very simple doubt about Objects
0

#1

I was reading the documentation in w3. And they says at the end of this link:
"Do Not Declare Strings, Numbers, and Booleans as Objects!"
http://www.w3schools.com/js/js_objects.asp

So it’s wrong this code? Or they are referring to another thing? I’m not quite sure.


#2

Your code is fine, you’re declaring your own Object. This warning reffers only to these three statements
var x = new String(); // Declares x as a String object var y = new Number(); // Declares y as a Number object var z = new Boolean(); // Declares z as a Boolean object


#3

Aaah! Everything it’s clear now. Thanks Maciej!! :wink: