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 trialjlampstack
23,932 PointsVariable 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
231,269 PointsI 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!
jlampstack
23,932 PointsGood to know. Thanks!
tal Shnitzer
Courses Plus Student 5,242 Pointstal Shnitzer
Courses Plus Student 5,242 Pointsthanks for asking. I get this as well