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

156
Views
Not able to understand this prototype concept

I was going through an article` and I came across this code , where it was explaining about prototype, and how it works. What I want is , what does this sentence mean with respect to the code.

This code creates a Date object, then walks up the prototype chain, logging the prototypes. It shows us that the prototype of myDate is a Date.prototype object, and the prototype of that is Object.prototype

const myDate = new Date();
let object = myDate;

do {  
  object = Object.getPrototypeOf(object);
  console.log(object);

} while (object);
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

It’s actually quite straightforward:

const myDate = new Date();   // Create a Date object.
let object = myDate;

do {  
  object = Object.getPrototypeOf(object); // Find the object’s prototype.
  console.log(object);                    // Print to the log.
} while (object);            // Repeat (finding prototypes’ prototypes)
                             // as long as there are prototypes to be found.

So, we will find out that the object’s prototype also has a prototype. That’s the chain the excerpt talks about.

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!