Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

multiple choice 1 point what will be the order of letters printed to th…

Question

multiple choice 1 point
what will be the order of letters printed to the console when this program is run?
1 console.log(\a\);
2 letters();
3 letters();
4 function letters() {
5 console.log(\b\);
6 console.log(\c\);
7 }

abca
abcbcbc
abc
abcbc

Explanation:

Step1: Analyze the first call

The first line console.log("a") prints "a". Then letters() is called. Inside the letters function, "b" and "c" are printed. So after the first letters() call, we have "a", "b", "c".

Step2: Analyze the second call

Then there is a second letters() call. Again, inside the letters function, "b" and "c" are printed.

Answer:

abcbc