Pre Exam Test Practice (SSC | Banking | IAS | GATE | State Level | CLAT | Railways | Insurance | Teaching Exams | NDA | Defence | IES |State Exam )

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 14, 2015 by SteGERY
0 votes
6 views



Related Hot Questions



Government Jobs Opening


...