0

What is the diffence between object a and b ?

var a = []; a["name"] = "John"; a["age"] = 46; document.write(a.name); var b = {name: "umesh", age: 33} document.write(b.name)

14th May 2019, 1:33 PM
Umesh Kushwaha
Umesh Kushwaha - avatar
2 Réponses
+ 3
a's age is 46, b's age is 33. a's name is "John", b's name is "umesh". No other differences.
15th May 2019, 7:46 AM
Seb TheS
Seb TheS - avatar
0
a.length = 0 b.length = undefined
15th May 2019, 8:17 AM
Umesh Kushwaha
Umesh Kushwaha - avatar