JavaScript Introducing ES2015 Classes Structure of Class

jlampstack
jlampstack
17,749 Points

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.

tal Shnitzer
tal Shnitzer
Pro Student 5,242 Points

thanks for asking. I get this as well

1 Answer

Steven Parker
Steven Parker
171,327 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!

jlampstack
jlampstack
17,749 Points

Good to know. Thanks!