Skip to content

Instantly share code, notes, and snippets.

@calag4n
calag4n / log.js
Last active February 16, 2021 13:44
The function displays more visible logs in console (cleared by default), make table of arrays and group elements when a string is passed in isMapped argument. See example below, in comments.
export const log = (obj, clear = true, mapKey) => {
const title = "font-size: 19px; color: #e65264"
if (clear) {
console.clear()
}
if (mapKey) {
console.group(mapKey)
obj.map(o => console.log(o))