I’ve been testing my code a couple of times now and I’ve been getting the same errors in the output :
Failed Test 1: Not logging the consoleStyler() variables
Passed Test 2: successfully logged celebrateStyler() variables
Failed Test 3: Not calling consoleStyler() and celebrateStyler()
Failed Test 4: Not calling styleAndCelebrate()
with the code that I have here :
function consoleStyler(color, background, fontSize, txt) {
var message = "%c" + txt;
var style = `color: ${color}`;
style += `background: ${background}`;
style += `font-size: ${fontSize}`;
console.log(message, style);
}
function celebrateStyler(reason) {
var fontStyle = "color: tomato; font-size: 50px";
if (reason == "birthday") {
console.log(`%cHappy birthday`, fontStyle);
} else if (reason == "champions") {
console.log(`%cCongrats on the title!`, fontStyle);
} else {
console.log("no message and style is provided");
}
}
function styleAndCelebrate(color, background, fontSize, txt, reason) {
consoleStyler(color, background, fontSize, txt);
celebrateStyler(reason);
}
consoleStyler('#1d5c63', '#ede6db', '40px', 'Congrats!');
celebrateStyler('birthday');
styleAndCelebrate('ef7c8e', 'fae8e0', '30px', 'You made it!', 'champions');
here’s the complete output that I have for the functions :
Congrats!
undefined
Happy birthday
undefined
You made it!
Congrats on the title!
undefined
I’m confused about where I’m not calling/referring to the functions and its variables and will need some assistance on this please, thanks.