r/learnjavascript • • Aug 18 '21

How do I console.log this constructor?

Post image
124 Upvotes

46 comments sorted by

View all comments

2

u/[deleted] Aug 19 '21 edited Sep 29 '25

vast chase rain important yam sip fall deserve beneficial squeeze

This post was mass deleted and anonymized with Redact

1

u/electron_myth Aug 19 '21

(new Student()).constructor

yes this works

5

u/skerit Aug 19 '21

Student.prototype.constructor is a reference to Student, so there's no need to create an instance just to get the constructor.

1

u/[deleted] Aug 19 '21 edited Sep 29 '25

consist station angle start attraction grab marble handle serious merciful

This post was mass deleted and anonymized with Redact