JavaScript Object Constructor Notation - JavaScript Tutorial 72

preview_player
Показать описание
Notes for You:: How to Create Objects using JavaScript Object Constructor Notation

Object constructor:
- is a constructor function of built in object called Object.
- is convenient to create a single object.

A) How to Create a new object using Object():

Syntax:
var objectName = new Object();

Example:
var rect1 = new Object();

new keyword in JavaScript:
a) Creates a new empty object.
c) Calls its Constructor function with "newly created memory location address" with "list of arguments" if passed.
d) Returns the reference of new object, if Constructor function does not return anything explicitly.

=========================================

Follow the link for next video:
JavaScript Tutorial 73 - How to Add or Delete a Property of an Object in JavaScript

Follow the link for previous video:
JavaScript Tutorial 71 - How to create Objects in JavaScript ?

=========================================

JavaScript Tutorials Playlist:-

=========================================
Watch My Other Useful Tutorials:-

jQuery Tutorials Playlist:-

jQuery UI Tutorials Playlist:-

Bootstrap Tutorials Playlist:-

=========================================

► Subscribe to our YouTube channel:

► Visit our Website:

=========================================
Hash Tags:-
#ChidresTechTutorials #JavaScript #JavaScriptTutorial
Рекомендации по теме
Комментарии
Автор

SUBSCRIBE, SHARE & SUPPORT:
VISIT & LEARN AT FREE OF COST:

ChidresTechTutorials
Автор

you'll always be the best teacher Chidre, keep it up

mathiasmatanda
Автор

Mr. Chidre, I would like to thank you from the bottom of my heart, for all the effort that you have done for us ! I will pray to God for your well-beeing. If you have time, I am sorry to bother you, can you please answer me very quckly theese questions, because 5 days have passed and I still cannot understand this things: 1. The big brown Object on the right size, which holds the function and prototype, this is the Main Object that you have mentioned in the previous tutorial as the object from all other Objects are beeing built, the MasterMind object ? And by pointing, it means that the memory location or object, which points to another place, it means that it holds the adress, it holds the same value, but they are not identical !? constructor points to the function, that means the constructor has the value of the function ?

obsedatr
Автор

Your tutorial are best of all to understand.. But I didn't understand this tutorial it is very complicate pls come with another video with this topic

letsknowthis
Автор

More deep concept of object in JavaScript: The concept is a little bit advanced as it asks clear understanding of memory referencing probably the memory management techniques in computer architecture and operating systems also. But you tried your best to make it clear with the help of pointing arrows.

teklenegash
Автор

Array in JavaScript is a class or object?

shanmugapriya
Автор

Hi sir.difference between creating object using object literal notation and object literal clearly i understood by seeing your videos.But what is the difference between these two..?

constructor function

function Vehicle(make, model, color, year) {
this.make = make,
this.model = model,
this.color = color,
this.year = year,
this.getName = function () {
return this.make + " " + this.model;
}
}


var car = new Vehicle("Toyota", "Corolla", "Black");
car.make;
car.color;
car.getName();


class:

class Vehicle {
constructor(make, model, color) {
this.make = make;
this.model = model;
this.color = color;
}

getName() {
return this.make + " " + this.model;
}
}


var car = new Vehicle("Toyota", "Corolla", "Black");
car.make;
car.color;
car.getName();

Thanks in advance.

shanmugapriya