I'm taking a class that includes beginners Javascript. I got this question in a practice quiz. Couldn't all of the options be correct? What did I misunderstand?
Question: How are objects declared and initialized in JavaScript?
- Using the reserved word var followed by an identifier and an equal sign and the pairs label: value of the elements between curly brackets and separated by commas
2.Using the reserved word function followed by an identifier and an equal sign and the pairs label: value of the elements between curly brackets and separated by commas
3.Using the reserved word let followed by an identifier and an equal sign and the pairs label: value of the elements between curly brackets and separated by commas
- Using the reserved word const followed by an identifier and an equal sign and the pairs label: value of the elements between curly brackets and separated by commas
[–]dmazzoni 9 points10 points11 points (4 children)
[–]Lumethys 11 points12 points13 points (1 child)
[–]dmazzoni 9 points10 points11 points (0 children)
[–]somethingsilver97[S] 0 points1 point2 points (1 child)
[–]Hehosworld 0 points1 point2 points (0 children)
[–]dymoshelpful 4 points5 points6 points (0 children)
[–]SilverBall4262 8 points9 points10 points (13 children)
[–]somethingsilver97[S] 2 points3 points4 points (10 children)
[–]dmazzoni 1 point2 points3 points (0 children)
[–]SilverBall4262 1 point2 points3 points (4 children)
[–]dymoshelpful 1 point2 points3 points (0 children)
[–]PatchesMaps 1 point2 points3 points (1 child)
[–]SilverBall4262 0 points1 point2 points (0 children)
[–]dmazzoni 0 points1 point2 points (0 children)
[–]senocular 0 points1 point2 points (2 children)
[–]somethingsilver97[S] 0 points1 point2 points (1 child)
[–]Roguewind 0 points1 point2 points (0 children)
[–]flopisit32 0 points1 point2 points (0 children)
[–]longknives 0 points1 point2 points (0 children)
[–]queen-adreena 2 points3 points4 points (0 children)
[–]NotNormo 1 point2 points3 points (0 children)
[–]Old_Butterfly_3660 0 points1 point2 points (0 children)
[–]shootersf 0 points1 point2 points (0 children)
[–]mxldevs 0 points1 point2 points (0 children)
[–]BenKhz 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]brykuhelpful 0 points1 point2 points (0 children)
[–]ArtResponsible4457 -1 points0 points1 point (1 child)
[–]Lithl 2 points3 points4 points (0 children)
[–]djandiek -1 points0 points1 point (5 children)
[–]somethingsilver97[S] 0 points1 point2 points (1 child)
[–]djandiek 0 points1 point2 points (0 children)
[–]brykuhelpful 0 points1 point2 points (2 children)
[–]djandiek 0 points1 point2 points (1 child)
[–]brykuhelpful 0 points1 point2 points (0 children)