Object Literal Notation in JavaScript

Rumman Ansari   Software Engineer   2024-09-29 08:04:58   577  Share
Subject Syllabus DetailsSubject Details Login to Open Video
☰ TContent
☰Fullscreen

Table of Content:



// Creating an object using object literal notation
var person = {
    firstName: "Rumman",
    lastName: "Ansari",
    age: 30,
    greet: function() {
        console.log("Hello, " + this.firstName + " " + this.lastName);
    }
};


Mastering JavaScript: From Fundamentals to Advanced Concepts

Stay Ahead of the Curve! Check out these trending topics and sharpen your skills.