I want to quickly disable all console.[log, time, error] messages in my code. I am aware of what has been asked before for javascript. But Typescript is complaining of my "solution" bellow:
const konsole = {
log:()=>{},
time:()=>{},
timeEnd:()=>{},
error:()=>{}
}
(!dev) && console = konsole
Where dev
is a boolean that is true when I am in development mode.
Typescript complaints: This expression is not callable.
I don't understand the complaint and what should I do instead.