I am learning Js Oops then i came across this weird thing, i tried following code in chrome console.
or here is the code
>> var name = new String(undefined);
>> undefined
>> name
>> "undefined"
>> var nString = new String(undefined);
>> undefined
>> nString
>> String {0: "u", 1: "n", 2: "d", 3: "e", 4: "f", 5: "i", 6: "n", 7: "e", 8: "d", length: 9}
one variable (name) returns a string , while the other variable(nString) returns object, how is it possible.