Closed Nalini1998 closed 1 year ago
What would the output of this block of code be?
const animal = 'cat'; for (let i = 0; i < animal.length; i++) { console.log(animal[i]); for (let j = 1; j < 4; j++) { console.log(j); } }
A. 1 c a t 2 c a t 3 c a t
B. 1 c 2 a 3 t
C. c 1 2 3 a 1 2 3 t 1 2 3
D. c a t 1 2 3
I chose C. c 1 2 3 a 1 2 3 t 1 2 3
What would the output of this block of code be?
A. 1 c a t 2 c a t 3 c a t
B. 1 c 2 a 3 t
C. c 1 2 3 a 1 2 3 t 1 2 3
D. c a t 1 2 3