Exercise

Exercise

  1. Right click to Download the file and save it as exersice13.2.html in the folder "yourNameWEB2JS". Open the file in your browser to see the results.
  2. Open the file in your editor, and replace the loop statement with other statements (for, while etc). You can also apply the for ... of statement. We want to have the same results.

Answer:

for (let i=0; i<users.length; i++) {
  let y=new User (users[i])
  y.sayHi();
  console.log(y);
}