+ 2

What's difference to assign object property by (: ) and by (=) ?

29th May 2019, 3:24 PM
Fabien First
Fabien First - avatar
2 odpowiedzi
+ 1
W3school explains working with Objects in more detail. If you want to create a class like structure you can do it as a function constructor: function ObjectOne(prop1,prop2){ this.prop1 = prop1; this.prop2 = prop2; } var obj = new ObjectOne(2,"two");
29th May 2019, 5:08 PM
Stoyan Todorov
Stoyan Todorov - avatar
29th May 2019, 4:46 PM
Stoyan Todorov
Stoyan Todorov - avatar