Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

149
Views
Creating usual object using Object.create?
let animal = {
    eats: true
  };
let rabbit = Object.create(animal, {
     jumps: {
     value: true, 
     writable: true,
     configurable: true 
    }
   });

console.log(rabbit.__proto__); // logs: {eats: true};
console.log(animal); // logs: {eats: true};
console.log(rabbit.jumps); // logs: true;
console.log(rabbit); // logs {} 

The question is: if rabbit is empty for real, what happend?
animal - has no jumps property
animal.proto - has no jumps property
rabbit - has no jumps property
rabbit.jumps - is true

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Your new property is not enumerable - if it were it would show up in a text-based console (Your original code shows up in an object-based console like chrome for example):

const animal = {eats:true}

let rabbit = Object.create(animal, {
    jumps: {
      value: true, 
      writable: true,
      configurable: true ,
      enumerable:true
    }
  });

console.log(rabbit.__proto__); // logs: {eats: true};
console.log(animal); // logs: {eats: true};
console.log(rabbit.jumps); // logs: true;
console.log(rabbit); // logs as you expected

From the docs for Object.defineProperties():

enumerable
true if and only if this property shows up during enumeration of the properties on the corresponding object. Defaults to false.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!