JSFiddle - React, Tailwind, and code Playground

by tuanderful

JavaScript

var person = {
    name: "Tuan"
}

personDescriptor = Object.getOwnPropertyDescriptor(person, "name");
console.log(personDescriptor);

/*
Object {
  value: "Tuan",
  writable: true,
  enumerable: true,
  configurable: true
}
*/

var person2 = {};
person2.name = "Tuan";
person2Descriptor = Object.getOwnPropertyDescriptor(person2, "name");
console.log(person2Descriptor);

/*
Object {
  value: "Tuan",
  writable: true,
  enumerable: true,
  configurable: true
}
*/