The ultimate guide to understanding JavaScript class pattern

Consider an empty object. Print the object using toString method.

We get the result [object Object] in the console. How does it work? (Interview question). Developers who have a strong background in C++ or C# will blindly attribute it to OOPs.