Advanced JavaScript - Chapter 6 - JavaScript - Constructor

preview_player
Показать описание
Constructor in JavaScript:
In programming languages like Java or C#, a class can have one or more constructors.
In JavaScript, a function can have one or more parameters.
So, a function with one or more parameters can be used like a constructor where you can pass parameter values at the time of creating an object with new keyword.
Parameter will be assigned to a property, if parameter value is not passed while creating an object using new then they will be undefined.

ankpro
ankpro training
C#
C sharp
Bangalore
Rajajinagar
Selenium
Coded UI
Mobile automation testing
Mobile testing
JQuery
JavaScript
.Net
Components of the .Net framework
Комментарии
Автор

Hi nice explanation.

can you please provide explanation on difference between factory and constructor . and advantages of constructor over factory

harshaldonge