GoConqr has a new look! Let us know what you think.

Flashcards

Untitled

Sam Saiden English 2 cards

Cards in this deck (2)

  1. 1Object constructorThere are many ways to create objects in javascript as below
    Object constructor:
    The simplest way to create an empty object is using the Object constructor. Currently this approach is not recommended.
    var object = new Object();
    Object's create method:
    The create method of Object creates a new object by passing the prototype object as a parameter
    var object = Object.create(null);
    Object literal syntax:
    The object literal syntax is equivalent to create method when it passes null as parameter
    var object = {};
    Function constructor:
    Create any function and apply the new operator to create object instances,
    function Person(name){
    var object = {};
    object.name=name;
    object.age=21;
    return object;
    }
    var object = new Person("Sudheer");
    Function constructor with prototype:
    This is similar to function constructor but it uses prototype for their properties and methods,
    function Person(){}
    Person.prototype.name = "Sudheer";
    var object = new Person();
    This is equivalent to an instance created with an object create method with a function prototype and then call that function wi
  2. 2—

Information

Description
Flashcards on Untitled, created by Sam Saiden on 27/01/2021.
Created by
Sam Saiden
Views
1
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?