<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>constructor Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/constructor/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/constructor/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Wed, 13 Apr 2022 16:30:47 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>How do you use a date object in JavaScript?</title>
		<link>https://www.scmgalaxy.com/tutorials/how-do-you-use-a-date-object-in-javascript/</link>
					<comments>https://www.scmgalaxy.com/tutorials/how-do-you-use-a-date-object-in-javascript/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Fri, 06 Aug 2021 10:47:35 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[constructor]]></category>
		<category><![CDATA[date object]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[methods]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=7474</guid>

					<description><![CDATA[<p>Date The Date object provides a sophisticated set of methods for manipulating dates and times. • It reads client machine [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-do-you-use-a-date-object-in-javascript/">How do you use a date object in JavaScript?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Date</h2>



<p class="wp-block-paragraph">The Date object provides a sophisticated set of methods for manipulating dates and times.</p>



<p class="wp-block-paragraph">• It reads client machine date and time so if the client‟s date or time is incorrect, your script will reflect this fact.<br>• Days of week and months of the year are enumerated beginning with zero.<br>   0 – Sunday, 1 – Monday, and so on<br>   0 – January, 1 – February, and so on<br>• Days of the month begin with One.</p>



<h2 class="wp-block-heading">Creating Date Object</h2>



<p class="wp-block-paragraph">Date objects are created with the new Date() constructor. Date Objects created by programmers are static. They do not contain a ticking clock.</p>



<p class="wp-block-paragraph"><strong>Syntax:-</strong></p>



<script src="https://gist.github.com/vijaypk376/473657bb21d25131ca6f486e6127079e.js"></script>



<h2 class="wp-block-heading">Creating Date Object</h2>



<ul class="wp-block-list"><li>new Date( ) &#8211; new Date() creates a new date object with the current date and time.</li></ul>



<script src="https://gist.github.com/vijaypk376/0eb5b76780fafccc502cd3f219478b56.js"></script>



<h2 class="wp-block-heading">Creating Date Object</h2>



<ul class="wp-block-list"><li>new Date(milliseconds) – It creates a new date object as January 1, 1970, 00:00:00 Universal Time (UTC).</li></ul>



<p class="wp-block-paragraph"><strong>Ex: &#8211;</strong></p>



<script src="https://gist.github.com/vijaypk376/567d8fe0d2922ff2d7cab8d33c4ef37c.js"></script>



<h2 class="wp-block-heading">Creating Date Object</h2>



<ul class="wp-block-list"><li>new Date(year, month, day, hours, minutes, seconds, milliseconds) It creates an object with the date specified by the integer values for the year, month, day, hours, minutes, second, milliseconds. You can omit some of the arguments.</li></ul>



<script src="https://gist.github.com/vijaypk376/5d403b687c7ab94ae0981c0dcf88397c.js"></script>



<p class="wp-block-paragraph">Month and Week Day start with 0<br>0 – Sunday<br>0 – January<br>Month Day starts with 1<br>1 – 1</p>



<h2 class="wp-block-heading">Creating Date Object</h2>



<figure class="wp-block-table"><table><tbody><tr><td class="has-text-align-center" data-align="center"><strong>No. of arguments</strong></td><td class="has-text-align-left" data-align="left"><strong>Description (in order)</strong></td></tr><tr><td class="has-text-align-center" data-align="center">7</td><td class="has-text-align-left" data-align="left">year, month, day, hour, minute, second, millisecond</td></tr><tr><td class="has-text-align-center" data-align="center">6</td><td class="has-text-align-left" data-align="left">year, month, day, hour, minute, second</td></tr><tr><td class="has-text-align-center" data-align="center">5</td><td class="has-text-align-left" data-align="left">year, month, day, hour, minute</td></tr><tr><td class="has-text-align-center" data-align="center">4</td><td class="has-text-align-left" data-align="left">year, month, day, hour</td></tr><tr><td class="has-text-align-center" data-align="center">3</td><td class="has-text-align-left" data-align="left">year, month, day</td></tr><tr><td class="has-text-align-center" data-align="center">2</td><td class="has-text-align-left" data-align="left">year and month</td></tr><tr><td class="has-text-align-center" data-align="center">1</td><td class="has-text-align-left" data-align="left">Millisecond</td></tr></tbody></table></figure>



<h2 class="wp-block-heading">Creating Date Object</h2>



<ul class="wp-block-list"><li>new Date(dateString) &#8211; new Date(dateString) creates a new date object from a date string.</li></ul>



<p class="wp-block-paragraph">Ex: &#8211;<br>var tarikh = new Date(“May 12, 2018 10:16:05&#8243;)</p>



<figure class="wp-block-table"><table><tbody><tr><td class="has-text-align-center" data-align="center"><strong>Date Type</strong></td><td class="has-text-align-center" data-align="center"><strong>Format</strong></td><td class="has-text-align-center" data-align="center"><strong>Example</strong></td></tr><tr><td class="has-text-align-center" data-align="center">ISO Date</td><td class="has-text-align-center" data-align="center">YYYY-MM-DD</td><td class="has-text-align-center" data-align="center">&#8220;2018-06-21&#8221; (The International Standard)</td></tr><tr><td class="has-text-align-center" data-align="center">Short Date</td><td class="has-text-align-center" data-align="center">MM/DD/YYYY</td><td class="has-text-align-center" data-align="center">“06/21/2018&#8243;</td></tr><tr><td class="has-text-align-center" data-align="center">Long Date</td><td class="has-text-align-center" data-align="center">MMM DD YYYY</td><td class="has-text-align-center" data-align="center">“June 21 2018 or “21 June 2018&#8243;</td></tr></tbody></table></figure>



<h2 class="wp-block-heading">ISO Dates</h2>



<p class="wp-block-paragraph">ISO 8601 is the international standard for the representation of dates and times.</p>



<figure class="wp-block-table"><table><tbody><tr><td class="has-text-align-center" data-align="center">Description</td><td class="has-text-align-center" data-align="center">Format</td><td class="has-text-align-center" data-align="center">Example</td></tr><tr><td class="has-text-align-center" data-align="center">Year and Month</td><td class="has-text-align-center" data-align="center">Year and Month</td><td class="has-text-align-center" data-align="center">2018-06</td></tr><tr><td class="has-text-align-center" data-align="center">Only Year</td><td class="has-text-align-center" data-align="center">YYYY</td><td class="has-text-align-center" data-align="center">2018</td></tr><tr><td class="has-text-align-center" data-align="center">Date and Time</td><td class="has-text-align-center" data-align="center">YYYY-MM-DDTHH:MM: SSZ</td><td class="has-text-align-center" data-align="center">2018-06-21T12:00:00Z</td></tr><tr><td class="has-text-align-center" data-align="center">Date and Time</td><td class="has-text-align-center" data-align="center">YYYY-MM-DDTHH:MM:SS+HH: MM<br>YYYY-MM-DDTHH:MM:SS-HH: MM</td><td class="has-text-align-center" data-align="center">2018-06-21T12:00:00+06:30<br>2018-06-21T12:00:00-06:30</td></tr></tbody></table></figure>



<p class="wp-block-paragraph">Date and Time are separated with a capital T.<br>UTC time is defined with the capital letter Z.<br>If you want to modify the time relative to UTC, remove the Z and add +HH: MM or -HH: MM instead.</p>



<h2 class="wp-block-heading">Short Date</h2>



<ul class="wp-block-list"><li><strong>Short dates are written in an &#8220;MM/DD/YYYY&#8221; format.</strong></li><li><strong>In some browsers, months or days with no leading zeroes may produce an error.</strong></li><li><strong>The behavior of &#8220;YYYY/MM/DD&#8221; is undefined. Some browsers will try to guess the format. Some will return NaN.</strong></li><li><strong>The behavior of &#8220;DD-MM-YYYY&#8221; is also undefined. Some browsers will try to guess the format. Some will return NaN.</strong></li></ul>



<h2 class="wp-block-heading">Long Date</h2>



<p class="wp-block-paragraph">Long dates are most often written in a &#8220;MMM DD YYYY&#8221; format.<br>Month and day can be in any order.<br>A month can be written in full (January), or abbreviated (Jan).<br>If you write “June 21, 2018” Commas are ignored and Names are case insensitive.</p>



<h2 class="wp-block-heading">Set Date Methods</h2>



<ul class="wp-block-list"><li><strong>setDate()                               Set the day as a number (1-31)</strong></li><li><strong>setFullYear()                          Set the year (optionally month and day)</strong></li><li><strong>setHours()                             Set the hour (0-23)</strong></li><li><strong>setMilliseconds()                   Set the milliseconds (0-999)</strong></li><li><strong>setMinutes()                          Set the minutes (0-59)</strong></li><li><strong>setMonth()                            Set the month (0-11)</strong></li><li><strong>setSeconds()                         Set the seconds (0-59)</strong></li><li><strong>setTime()                               Set the time (milliseconds since January 1, 1970)</strong></li></ul>



<h2 class="wp-block-heading">Get Date Methods</h2>



<ul class="wp-block-list"><li><strong>getFullYear()                        Get the year as a four digit number (yyyy)</strong></li><li><strong>getMonth()                          Get the month as a number (0-11)</strong></li><li><strong>getDate()                             Get the day as a number (1-31)</strong></li><li><strong>getHours()                           Get the hour (0-23)</strong></li><li><strong>getMinutes()                        Get the minute (0-59)</strong></li><li><strong>getSeconds()                        Get the second (0-59)</strong></li><li><strong>getMilliseconds()                 Get the millisecond (0-999)</strong></li><li><strong>getTime()                             Get the time (milliseconds since January 1, 1970)</strong></li><li><strong>getDay()                               Get the weekday as a number (0-6)</strong></li></ul>



<h2 class="wp-block-heading">Converting Dates to String</h2>



<p class="wp-block-paragraph">If you want to create a string in a standard format, Date provides three methods: &#8211;</p>



<ul class="wp-block-list"><li><strong>toString( )</strong></li><li><strong>toUTCString( )</strong></li><li><strong>toGMTString( )</strong></li></ul>



<p class="wp-block-paragraph">toUTCString ( ) and toGMTString ( ) format the string according<br>to Internet (GMT) standards, whereas toString ( ) creates the<br>string according to Local Time.</p>



<h2 class="wp-block-heading">Date Methods</h2>



<ul class="wp-block-list"><li><strong>getDate()                               Returns the day of the month (from 1-31)</strong></li><li><strong>getDay()                                Returns the day of the week (from 0-6)</strong></li><li><strong>getFullYear()                          Returns the year</strong></li><li><strong>getHours()                            Returns the hour (from 0-23)</strong></li><li><strong>getMilliseconds()                  Returns the milliseconds (from 0-999)</strong></li><li><strong>getMinutes()                         Returns the minutes (from 0-59)</strong></li><li><strong>getMonth()                           Returns the month (from 0-11)</strong></li><li><strong>getSeconds()                        Returns the seconds (from 0-59)</strong></li><li><strong>getTime()                              Returns the number of milliseconds since midnight Jan 1 1970, and a specified date</strong></li><li><strong>getTimezoneOffset()            Returns the time difference between UTC time and local time, in minutes</strong></li><li>getUTCDate()                         Returns the day of the month, according to universal time (from 1-31)</li><li>getUTCDay()                          Returns the day of the week, according to universal time (from 0-6)</li><li>getUTCFullYear()                    Returns the year, according to universal time</li><li>getUTCHours()                       Returns the hour, according to universal time (from 0-23)</li><li>getUTCMilliseconds()             Returns the milliseconds, according to universal time (from 0-999)</li><li>getUTCMinutes()                    Returns the minutes, according to universal time (from 0-59)</li><li>getUTCMonth()                      Returns the month, according to universal time (from 0-11)</li><li>getUTCSeconds()                   Returns the seconds, according to universal time (from 0-59)</li><li>now()                                      Returns the number of milliseconds since midnight Jan 1, 1970</li><li>parse()                                    Parses a date string and returns the number of milliseconds since January 1, 1970</li><li>setDate()                                Sets the day of the month of a date object</li><li>setFullYear()                           Sets the year of a date object</li><li>setHours()                              Sets the hour of a date object</li><li>setMilliseconds()                   Sets the milliseconds of a date object</li><li>setMinutes()                          Set the minutes of a date object</li><li>setMonth()                            Sets the month of a date object</li><li>setSeconds()                         Sets the seconds of a date objec</li></ul>



<ul class="wp-block-list"><li>setTime()                              Sets a date to a specified number of milliseconds after/before January 1, 1970</li><li>setUTCDate()                        Sets the day of the month of a date object, according to universal time</li><li>setUTCFullYear()                   Sets the year of a date object, according to universal time</li><li>setUTCHours()                      Sets the hour of a date object, according to universal time</li><li>setUTCMilliseconds()            Sets the milliseconds of a date object, according to universal time</li><li>setUTCMinutes()                   Set the minutes of a date object, according to universal time</li><li>setUTCMonth()                     Sets the month of a date object, according to universal time</li><li>setUTCSeconds()                   Set the seconds of a date object, according to universal time</li><li>toDateString()                       Converts the date portion of a Date object into a readable string</li><li>toISOString()                         Returns the date as a string, using the ISO standard</li><li>toJSON()                               Returns the date as a string, formatted as a JSON date</li><li>toLocaleDateString()             Returns the date portion of a Date object as a string, using locale conventions</li><li>toLocaleTimeString()             Returns the time portion of a Date object as a string, using locale conventions</li><li>toLocaleString()                     Converts a Date object to a string, using locale conventions</li><li>toString()                               Converts a Date object to a string</li><li>toTimeString()                       Converts the time portion of a Date object to a string</li><li>toUTCString()                        Converts a Date object to a string, according to universal time</li><li>UTC()                                     Returns the number of milliseconds in a date since midnight of January 1, 1970,                                <ul><li>                                    according to UTC time</li></ul></li><li>valueOf()                               Returns the primitive value of a Date object</li></ul>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-do-you-use-a-date-object-in-javascript/">How do you use a date object in JavaScript?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/how-do-you-use-a-date-object-in-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to work Number type in JavaScript</title>
		<link>https://www.scmgalaxy.com/tutorials/how-to-work-number-type-in-javascript/</link>
					<comments>https://www.scmgalaxy.com/tutorials/how-to-work-number-type-in-javascript/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Thu, 05 Aug 2021 11:14:58 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Accessing Number]]></category>
		<category><![CDATA[constructor]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Number type]]></category>
		<category><![CDATA[Number with String]]></category>
		<category><![CDATA[Primitive]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=7440</guid>

					<description><![CDATA[<p>Numbers Number type in JavaScript includes both integer and floating-point values. JavaScript numbers are always stored as double-precision floating-point numbers, [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-to-work-number-type-in-javascript/">How to work Number type in JavaScript</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Numbers</h2>



<p class="wp-block-paragraph">Number type in JavaScript includes both integer and floating-point values. JavaScript numbers are always stored as double-precision floating-point numbers, following the international IEEE 754 standard.</p>



<p class="wp-block-paragraph">JavaScript also provides an object representation of numbers.</p>



<p class="wp-block-paragraph"><strong>Ex:-</strong>  </p>



<p class="wp-block-paragraph"><strong>12<br>23.45<br>5e3</strong></p>



<h2 class="wp-block-heading">Numbers</h2>



<p class="wp-block-paragraph"><strong>Primitive</strong></p>



<script src="https://gist.github.com/vijaypk376/820b589ad4c674904056bf2250f9d937.js"></script>



<p class="wp-block-paragraph"><strong>Constructor</strong></p>



<script src="https://gist.github.com/vijaypk376/67f2adb16d1a1de8765501c0845f66b2.js"></script>



<h2 class="wp-block-heading">Accessing Number</h2>



<script src="https://gist.github.com/vijaypk376/17d57ef9f17f05e88d23930a4b36ba82.js"></script>



<h2 class="wp-block-heading">Number with String</h2>



<script src="https://gist.github.com/vijaypk376/f8c34d9fc2424e5941ab6f7316cb582e.js"></script>



<h2 class="wp-block-heading">NaN</h2>



<p class="wp-block-paragraph">The NaN property represents the &#8220;Not-a-Number&#8221; value. This property indicates that a value is not a legal number. NaN never compares equal to anything, even itself.<br>The NaN property is the same as the Number. Nan property.</p>



<h2 class="wp-block-heading">Global isNaN ( ) Method</h2>



<p class="wp-block-paragraph">The isNaN() function is used to determines whether a value is an illegal number (Not-a-Number).<br>This function returns true if the value equates to NaN. Otherwise, it returns false.<br>This function is different from the Number specific Number.isNaN() method.<br>The global isNaN() function, converts the tested value to a Number, then tests it.</p>



<p class="wp-block-paragraph"><strong>Syntax: &#8211; isNaN(value)</strong></p>



<h2 class="wp-block-heading">Infinity and – Infinity</h2>



<p class="wp-block-paragraph">Infinity or -Infinity is the value JavaScript will return if a number is too large or too small. All Infinity values compare equal to each other.</p>



<p class="wp-block-paragraph"><strong>Ex:-<br>document.write(5 / 0); // infinity<br>document.write(- 5 / 0); // &#8211; infinity</strong></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-to-work-number-type-in-javascript/">How to work Number type in JavaScript</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/how-to-work-number-type-in-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How do classes work in JavaScript?</title>
		<link>https://www.scmgalaxy.com/tutorials/how-do-classes-work-in-javascript/</link>
					<comments>https://www.scmgalaxy.com/tutorials/how-do-classes-work-in-javascript/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Wed, 04 Aug 2021 10:37:54 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Class Declaration]]></category>
		<category><![CDATA[classes]]></category>
		<category><![CDATA[constructor]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[Javascript]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=7377</guid>

					<description><![CDATA[<p>Class JavaScript classes, introduced in ECMAScript 2015 or ES 6, Classes are in fact &#8220;special functions&#8221;.There are two ways to [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-do-classes-work-in-javascript/">How do classes work in JavaScript?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Class</h2>



<p class="wp-block-paragraph">JavaScript classes, introduced in ECMAScript 2015 or ES 6, Classes are in fact &#8220;special functions&#8221;.<br><strong>There are two ways to define a class in JavaScript using class</strong> <strong>keyword:-</strong></p>



<ul class="wp-block-list"><li><strong>Class Declaration</strong></li><li><strong>Class Expression</strong></li></ul>



<h2 class="wp-block-heading">Class Declaration</h2>



<script src="https://gist.github.com/vijaypk376/974621414c83de4c47a06fc8d87aa16f.js"></script>



<h2 class="wp-block-heading">Constructor</h2>



<p class="wp-block-paragraph">The constructor method is a special method for creating and initializing an object created within a class. There can be only one special method with the name &#8220;constructor&#8221; in a class.</p>



<script src="https://gist.github.com/vijaypk376/3d6e81bb58ac1c06c5a8ea754085a471.js"></script>



<h2 class="wp-block-heading">Default Constructor</h2>



<p class="wp-block-paragraph">If you do not specify a constructor method a default constructor is used.</p>



<script src="https://gist.github.com/vijaypk376/6702713627450d4ab23989a0729ca7ba.js"></script>



<script src="https://gist.github.com/vijaypk376/1ccf561e940d0458f29d8b2b3b841cde.js"></script>



<h2 class="wp-block-heading">Parameterized Constructor</h2>



<script src="https://gist.github.com/vijaypk376/a0cbba23bfd43b943ebf8f170495b879.js"></script>



<h2 class="wp-block-heading">Class Expression</h2>



<p class="wp-block-paragraph">Class expressions can be named or unnamed.</p>



<script src="https://gist.github.com/vijaypk376/d39d0da6e8ff44610fbd6dfd2125cf5c.js"></script>



<h2 class="wp-block-heading">Class Hoisting</h2>



<p class="wp-block-paragraph">Class Declarations and Class Expression are not hoisted. You first need to declare your class and then access it.</p>



<script src="https://gist.github.com/vijaypk376/ba7cb5a6bb01b9ef92377df171661a88.js"></script>



<h2 class="wp-block-heading">Inheritance</h2>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="942" height="358" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/inheritance.png" alt="" class="wp-image-7378" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/inheritance.png 942w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/inheritance-300x114.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/inheritance-768x292.png 768w" sizes="(max-width: 942px) 100vw, 942px" /></figure>



<h2 class="wp-block-heading">Class Inheritance</h2>



<p class="wp-block-paragraph">The extends keyword is used in class declarations or class expressions to create a class that is a child of another class.<br>The extended keyword can be used to subclass custom classes as well as built-in objects.</p>



<script src="https://gist.github.com/vijaypk376/9445111d6b5f126178175f99ff892466.js"></script>



<h2 class="wp-block-heading">Class Inheritance</h2>



<ul class="wp-block-list"><li><strong>Inherit Built-in Object</strong></li></ul>



<p class="wp-block-paragraph"><strong>     – Date<br>    – String<br>    – Array</strong></p>



<p class="wp-block-paragraph">class myDate extends Date {<br>}</p>



<h2 class="wp-block-heading">Super</h2>



<p class="wp-block-paragraph">Super ( ) is used to initialize parent class constructor. If there is a constructor present in a subclass,<br>it needs to first call super() before using &#8220;this&#8221;. A constructor can use the super keyword to call the<br>constructor of a parent class.</p>



<script src="https://gist.github.com/vijaypk376/8ea04efa899dadf152c53bf0cf4fb147.js"></script>



<h2 class="wp-block-heading">Method Overriding</h2>



<p class="wp-block-paragraph">Same function name with different implementation.</p>



<p class="wp-block-paragraph">Parent &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;>   show ( ) {return “Super Class”; }<br>Child &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;>  show ( ) {return “Sub Class”; } show ( ) {return “Super Class”; }</p>



<h2 class="wp-block-heading">Static Method</h2>



<p class="wp-block-paragraph">The static keyword is used to define a static method for a class. Static methods are called without creating object and cannot be called through a class instance (object). Static methods are often used to create utility functions for an<br>application.</p>



<script src="https://gist.github.com/vijaypk376/c4ebef30dbdcdbed4e2addf8d02c9748.js"></script>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-do-classes-work-in-javascript/">How do classes work in JavaScript?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/how-do-classes-work-in-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How does constructor work in JavaScript?</title>
		<link>https://www.scmgalaxy.com/tutorials/how-does-constructor-work-in-javascript/</link>
					<comments>https://www.scmgalaxy.com/tutorials/how-does-constructor-work-in-javascript/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Tue, 03 Aug 2021 10:22:26 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[constructor]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Parameters]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=7307</guid>

					<description><![CDATA[<p>Constructor Object instance are created with constructor, which is basically a special function that prepares a new instance of an [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-does-constructor-work-in-javascript/">How does constructor work in JavaScript?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Constructor</h2>



<p class="wp-block-paragraph">Object instance are created with constructor, which is basically a special function that prepares a new instance of an object for use.</p>



<script src="https://gist.github.com/vijaypk376/7c4f0358d9ed9b298884b822de90cd25.js"></script>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="768" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/constructor.jpg" alt="" class="wp-image-7310" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/constructor.jpg 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/constructor-300x225.jpg 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/08/constructor-768x576.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">Constructor with Parameter</h2>



<script src="https://gist.github.com/vijaypk376/2c4269caa580e58a122ac08f1e86b849.js"></script>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-does-constructor-work-in-javascript/">How does constructor work in JavaScript?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/how-does-constructor-work-in-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
