Book
Submodule 13.2: JavaScript classes
Submodule 13.2: JavaScript classes
Completion requirements
View
- Introduction to JavaScript classes
- The syntax of JavaScript classes
- Create objects with JavaScript classes
- Methods inside 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);
}