0
Object inititalization
I really wanted to ask. Between this to code, which is better Var person={name:"Afeez", age:19}; And Var person={ Name:"Afeez", age:19, };
2 Answers
+ 4
Korede they are exactly the same
However, this is normally done in one line like the first example:
Var person={name:"Afeez", age:19};
+ 1
Both of them are one and the same thing, just the second one looks more clear and properly intended but in case when you have large number of objects with small names than first one is recommended