reading-notes

Class Seven Notes (201)

More on Object-Oriented Programming, HTML Tables

Lecture Notes

function ConstructorFunction(x) { this.x = value0; this.a = value1; this.b = value2; this.newFunction = function() { //code to be part of the function};
} }

// we use the keyworkd new to create a new instance of the construtor function let xxx1 = new ConstructorFunction(); let xxx2 = new ConstructorFunction(); //output would contain the keyworkd ConstructorFunction

//create new properties of the constructorFunction for one object variable.newInstance = ‘a string’

create new properties for all objects created, use keyworkd prototype ConstructorFunction.prototype.newInstance = ‘a string’

use a for-loop to invoke all student at once let array = [array[0], array[1],array[2]]; //create instances of items to be iterated for (let i=0; i < array.length, i++) {array[i].newFunction()};

more DOM stuff today: xxx.setAtrribute(‘HTML attribute”, value)

Lecture Notes (tables on HTML)1

Domain Modeling2

HTML Table Basics3

Intro to Constructors4 5

Things I want to know more about

Back to main page

References

  1. https://www.w3schools.com/html/html_tables.asp 

  2. https://github.com/codefellows/domain_modeling#domain-modeling 

  3. https://developer.mozilla.org/en-US/docs/Learn/HTML/Tables/Basics 

  4. https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Basics#introducing_constructors 

  5. https://ui.dev/beginners-guide-to-javascript-prototype