Answers for "javascript give color to console.log"

17

js console log with color

console.log('%c Oh my heavens! ', 'background: #222; color: #bada55');
Posted by: Guest on April-09-2020
0

typescript how to color your console loggers

//has to be backtick comma to interpolate.
public colorLogger(str: any, color = "red"){
    console.log(`%c ${str}`, `color: ${color}; font-weight: bold;`);
}
Posted by: Guest on October-15-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language