143,646 views
28 votes
28 votes
Consider this program on the picture attached:

(a) In what programming language is this program implemented?
(b) Why is this program correct? In other words, how does it work?
(c) In what way is the program poorly designed?

Consider this program on the picture attached: (a) In what programming language is-example-1
User Smoothumut
by
3.1k points

1 Answer

8 votes
8 votes

Answer:

a) Javascript

b) The program works because it iterates through an array and logs each array element into the console

c) It is poorly designed because depending on the array element value, the program will have to wait that many milliseconds before it logs and move on to the next element. This isn't good because the program may take a long time to execute if the array contains elements with large values.

User Jvasak
by
2.7k points