Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  A small trick on using console.log to print data in JavaScript

When debugging JavaScript application, one may frequently use console.log to print data so that it is easy to debug when issue occurs and also helps on understand the data flow. The common way of printing a variable would be something like. let user = { name: "test"};console.log(user);In this case it will print:{ name: 'test' }This is OK when there is no much logging or the program is not complicated. But it becomes difficult to debug if there are lots of variables to be printed as there is no clear indication on which variable or object it is.So in this case one may add some extra log...

13,565 4       DEBUGGING CONSOLE.LOG JAVASCRIPT