Question: What is the correct way to write a JavaScript array? A. var colors = (1:red, 2:green, 3:blue) B. var colors = red, green, blue C.
What is the correct way to write a JavaScript array?
| A. | var colors = (1:"red", 2:"green", 3:"blue") | |
| B. | var colors = "red", "green", "blue" | |
| C. | var colors = 1 = ("red"), 2 = ("green"), 3 = ("blue") | |
| D. var colors = ["red", "green", "blue"]
2. What will be printed in the browser alert window based on the code below? var obj = JSON.parse('{"name" : "John", "age" : 30, "school" : "Wake Tech"}'); window.alert(obj.name + " attends " + obj.school); |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
