Nalini1998 / Project_Public

MIT License
2 stars 0 forks source link

What will be the result of the code block? #547

Closed Nalini1998 closed 1 year ago

Nalini1998 commented 1 year ago

What will be the result of the code block?

let socialMedia = ['Instagram', 'Facebook', 'Twitter'];

for (let socialMediaIndex = 0; socialMediaIndex < socialMedia.length; socialMediaIndex++) {
    console.log(socialMedia[socialMediaIndex]);
}

A. ‘Twitter’ ‘Facebook’ ‘Instagram’

B. ‘Instagram’ ‘Facebook’ ‘Twitter’

C. socialMedia[0] socialMedia[1] socialMedia[2]

D. ‘0: Instagram’ ‘1: Facebook’ ‘2: Twitter’

Nalini1998 commented 1 year ago

I chose

B. ‘Instagram’ ‘Facebook’ ‘Twitter’