Object-oriented programming, HTML tables
Domain Modeling
Explain why we need domain modeling.
Why should tables not be used for page layouts?
- Layout tables reduce accessibility for visually impaired users because screen readers’ output will be confusing to their users. Tables produce tag soup, which will be more difficult to write, maintain, and debug. Tables are not automatically responsive.
List and describe 3 different semantic HTML elements used in an HTML <table>.
-
element that denotes a header, tag, | element that denotes table data.
| |
Introducing Constructors
What is a constructor and what are some advantages to using it?
- Constructor is a function called using the new keyword.When a contructor is called it will create a new object, bind ‘this’ to the new object, run the code in the constructor, and return the new object. Contructors, by convention , stat with a capital letter and ar named for the type of object they create.
How does the term ‘this’ differ when used in an object literal versus when used in a constructor?
- ‘This’ keyword refers to the object that will be created by constructor function. On the other hadn, ‘this’ refers to the object it is part of when used in an object literal.
Object Prototypes Using A Constructor
Explain prototypes and inheritance via an analogy from your previous work experience.
- Prototype is a property that every function in Javasscript has and it allows us to share methods across all instances of a function. All the functionality is still the same but now instead of having to manage a separate object for all the methods, another object that comes built into the function itself can be used.
NOTE: This is a very common front end developer interview question
References