Although JavaScript is not my primary programming language, I decided to practice by attempting something simple - or so I thought ;)
Below is the code I wrote:
function Log () {}
Log.format = function (func, facility, text) {
func("hello");
};
Log.debug = function(facility, text) {
Log.format(console.warn);
};
However, when I try to call Log.debug("we", "deb"), I encounter an Uncaught TypeError: Illegal invocation error. What mistake am I making?