Organizational Research By

Surprising Reserch Topic

what is the difference between new object and object literal notation


what is the difference between new object and object literal notation  using -'javascript,object,jslint'

What is the difference between this constructor-based syntax for creating an object:

person = new Object()


...and this literal syntax:

person = {
    property1 : "Hello"
};


It appears that both do the same thing, although JSLint prefers you use object literal notation.

Which one is better and why?
    
asked Sep 16, 2015 by abhi
0 votes
7 views



Related Hot Questions



Government Jobs Opening


...