Submodule 13.2: JavaScript classes
Exercise
Exercise
- 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. - 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.
for (let i=0; i<users.length; i++) {
let y=new User (users[i])
y.sayHi();
console.log(y);
}