-
Domain modeling is the process of creating a conceptual model in code for a specific problem.
-
Domain model thats design and build correctly can verify and validate the understanding of the a problem.
-
To define the properties between many object we want to use a constructor function and we can define it using function expression
-
When modeling a single entity that'll have many instances, build self-contained objects with the same attributes and behaviors.
-
Model its attributes with a constructor function that defines and initializes properties.
-
Model its behaviors with small methods that focus on doing one job well.
-
Create instances using the
newkeyword followed by a call to a constructor function. -
Store the newly created object in a variable so you can access its properties and methods from outside.
-
Use the
thisvariable within methods so you can access the object's properties and methods from inside.
-
A table represents information in a grid format ,Grids allow us to understand complex data by referencing information on two axes
-
Examples of tables include financial reports, TV schedules, and sports results.
The
<table>element is used to create a tableThe start of each row we use
<tr>tagand its It is followed by
<td>tagwe use element to indicate the heading for column or a row
<table>
<tr>
<td>15</td>
<td>15</td>
<td>30</td>
</tr>
<tr>
<td>45</td>
<td>60</td>
<td>45</td>
</tr>
<tr>
<td>60</td>
<td>90</td>
<td>90</td>
</tr>
</table>
-
we can use the
newkeyword and the object constructor to create a blank object -
we can update the value of properties using the dot notation or square brackets
hotel.name = park( the hotel is object and.nameis propery name andparkproperty value
- We can create with properies and methods :
- literal notation
var hotel = {
name: 'Quay' ,
rooms: 40,
booked: 25,
checkAvailability: function() {
return this.rooms - this .booked;
}
} ;
- object constructor notation
function Hotel(name, rooms, booked) {
this.name = name;
th is.rooms = rooms;
this.booked = booked;
this.checkAvailability = function()
return this.rooms - this.booked;
} ;
var quayHotel =new Hotel('Quay', 40 , 25);
var parkHotel =new Hotel('Park', 120, 77);
- In JavaScript, data is represented using name/value pairs. To organize the data, we can use an array or object to group a set of related values. In arrays and objects the name is also known as a key
- A variable has just one key (the variable name) and one value
- Arrays can store multiple pieces of information.
-
Browsers come with a set of built-in objects that represent things like the browser window and the current web page shown in that window. These built-in objects act like a toolkit for creating interactive web pages.
-
JavaScript has several built-in objects such as String, Number, Math, and Date. Their properties and methods offer functionality that help you write scripts