+ 2
What's difference to assign object property by (: ) and by (=) ?
2 Réponses
+ 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");
+ 1
https://code.sololearn.com/W1J89cEkz4bc/?ref=app like this? It will not work