Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Introducing ES2015 Classes Structure of Class

Variable declaration DOES SHOW group when console.log()

On Guils screen it displays....

// Does not show Student
{ name: 'Joey', age: 25 }                                                                                               
{ name: 'Sarah', age: 22 }    

On my screen it displays....

Student { name: 'Joey', age: 25 }                                                                                               
Student { name: 'Sarah', age: 22 }    

What is the reason for this? Guil mentioned that's the only main difference for the result, between the variable, and the class, but for me they both return identical results, both showing STUDENT before the object.

1 Answer

Steven Parker
Steven Parker
231,236 Points

I expect that the version of node.js used by the workspace has been upgraded since the video was made, and displaying the object type as well as contents is a feature that was added to the newer version.

I like it!

Good to know. Thanks!