List of console capabilities --------------------------------------------------------------------------------------- console.log(console); This displays arrays and objects similar to JSON.stringify but in a neat table format. --------------------------------------------------------------------------------------- console.table(); Print specific array or object. --------------------------------------------------------------------------------------- console.table(myArray); console.table(myObject); Prints out a count of how many times it has been called. --------------------------------------------------------------- function msToNextQuarterHour() { console.count('msToNextQuarterHour()'); return 900000 - (new Date().getTime() % 900000); } console.count('msToNextQuarterHour()'); Prints out an assertion if it occurs. --------------------------------------------------------------- function msToNextQuarterHour() { console.assert(new Date().getTime() % 900000 === 0, 'Not Quarter Hour Yet!'); } Multiple arguments. --------------------------------------------------------------- var firstName = 'First'; var lastName = 'Last'; console.log('First Name: ', firstName, 'Last Name: ', lastName); Use html style to customize your log output. --------------------------------------------------------------- console.log("%cCLICKED!", "font-family:arial;color:green;font-weight:bold;font-size:3rem"); |