I tried this today on my browser console and saw something weird. Please help. Can someone help me understand why It happens ?
Try 1:
{}.toString(); // It shows an error - Uncaught SyntaxError: Unexpected token '.'
Try 2:
const a = {};
a.toString(); // It returns '[object Object]'