Javascript Object is a function used for creating new objects with empty or existing properties and member functions.

When we create objects using Object.create() properties and prototypes of the parent object get passed or inherited to new assigned objects.

Syntax

Object.create();

Table of Contents

  • Creating new object using Object.create()
  • Creating objects using null
  • Conclusion

Creating new object using Object.create()

var person = {
    "first_name" : "Rohan",
    "last_name" : "Patil",
    "full_name" : function(){
        return this.first_name+" "+this.last_name;
    }
}

var student = Object.create(person);
console.log(student);

//Console Output
{}

#javascript #web development

How to Create an Object in Javascript using Object.create() method for Beginners
5.80 GEEK