Practice how to implement a decorator for adding colors to the console with respect to the methods.
Problem statement
Write a decorator for the console that adds the red(message)
, yellow(message)
, and green(message)
methods. These methods should behave like console.log(message)
except they’ll print the message in red, yellow, or ...