📎 Webclip
5 functions of the Console object you didn’t know
The page points out that the Console object offers more than console.log(). It presents five methods that the author describes as useful in everyday work and says they were tested in Google Chrome 38.
Reading notes#
console.assert(expression, message)logs the given message when the first argument is false, and logs nothing when the expression is true.console.table(object)displays an object or array as a table.console.profile(name)starts a CPU profiler in the console, saves each run as a separate tab, and should be paired withconsole.profileEnd().console.group(message)groups following logs into a dropdown list untilconsole.groupEnd()is called, and groups can be nested.console.groupCollapsed(message)works likeconsole.group(message)but starts collapsed.console.time(name)starts a timer in milliseconds and is stopped withconsole.timeEnd(name)using the same name.
