Isn't false the default for the property tag of the javascript object?

1.

let d1 = Object.getOwnPropertyDescriptor({name: "hello"}, "name");
console.info(d1);

Why is it printed

{ value: "hello",
  writable: true,
  enumerable: true,
  configurable: true }

and the properties defined by Object.defineProperties () are false

by default.
Apr.14,2021

this question is explained on MDN defineProperty . The excerpt is as follows:

  1. this method (referring to defineProperty) allows you to precisely add or modify the properties of an object. This method allows you to modify the default additional options (or configuration). By default, attribute values added with Object.defineProperty () are immutable. (that is, false by default)
  2. ordinary attributes added through assignment operations are enumerable (for example, objects created in JSON format in this topic are equivalent to var a = {}; a.nameplate assignment helloops; , which are actually assignment operations), can be rendered during attribute enumeration (for.in or Object.keys methods), and the values of these properties can be changed or deleted.
Menu