Factory Function
When a function returns an object, we call it a factory function. It can produce object instance without new keywords or classes.
When a function returns an object, we call it a factory function. It can produce object instance without new keywords or classes.
A property of an object is some piece of named data it contains. These are accessed with dot
operator applied to an object alternative to the dot operator is the array [ ] operator.
Syntax: – object_name.property_name
Ex:-
Object members that are functions are called methods. These are accessed with dot operator applied
to an object alternative to the dot, the operator is the array [ ] operator.
Syntax: – object_name.Method_name( );
Ex:-
Syntax:-
Object_name.Property_name = value;
Object_name[„Property_name‟] = value;
Delete operator is used to delete instance properties.
Syntax:- delete object_name.property_name
Ex: – delete fees.Rahul
After removal with delete operator, the property has the undefined value.
A definition list is a list of terms, with a definition of each term.
We can create definition list by using the <dl> ………. </dl> with <dt> and <dd> tag.
The <dt> …….. </dt> tag is used to define the term; whrereas, the <dd> tag is used to give the term’s definition.
<dl>
<dt>College</dt>
<dd>A boring place</dd>
<dt>School</dt>
<dd>Learn as much as you can</dd>
<dt>University</dt>
<dd>for fun</dd>
</dl>
An ordered list displays a list of items using numbers or letters in either ascending or descending order.
The <ol> ………. </ol> tag is used to define an ordered list ; whereas the <li> ….. </li> tag is used to define the items of list.
Ex:-
<ol>
<li>Linux</li>
<li>Windows</li>
<li>Mac</li>
<li>Android</li>
</ol>
Attribute | Value |
Type | 1, A, a, I, i |
Start | Any numeric value |
Reversed | Reversed |
<ol type=1>
<li>Linux</li>
<li>Windows</li>
<li>Mac</li>
<li>Android</li>
</ol>
An unordered list is used to create a bulleted list of items.
The <ul> …………….. </ul> tag is used to define an unordered list; whereas, the <li> ……… </li> tag is used to define the items of the list.
Ex:-
<ul>
<li>Linux</li>
<li>Windows</li>
<li>Mac</li>
<li>Android</li>
</ul>