JSFiddle - React, Tailwind, and code Playground

by deepak sisodiya

JavaScript

// object in javascript is 
// 1. key value pair
// 2. comma-delimited
// 3. wrapped in curly braces

var alert  = function (str) {
   var st = document.createTextNode(str);
   var p = document.createElement('p');
   p.appendChild(st);
   document.querySelector('body').appendChild(p);
}

var person = {
    firstName: "Deepak",
    lastName : "Sisodiya",
    address  : "Indore",
    fullName : function (){
        return this.firstName + " " + this.lastName
    }
};

alert(person.firstName)
alert(person["firstName"])
alert(person.fullName())