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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!