Coursera Help ! i’m stuck when update update the style variable using the += operator

put in your code, so we can see and try to solve it.

what help do you need?

I don’t know, make sure that the functions do what you are required to do?

I followed the readme, i am wonder why it is giving me these fails

This is not the freeCodeCamp test suite, we don’t have any deep knowledge of that here

I see, Thanks for your time.

hey ! are you doing a functional programming challange right now?

Hi @ilenia , the post was gone right now, i think that the same challange that i worked couple days ago :rofl:

you are better equipped to help than me then

I think so :laughing: ,
next i’ll help others to fix this thing

Hello bro I have the same problem and my code is the same as above

Just put it your code here

// Task 1: Build a function-based console log message generator
function consoleStyler(color,background,fontSize,txt) {
message = “%c” + txt;
style = color: ${color};
style += background: ${background};
style += font-size: ${fontsize};
console.log(message,style)
}

// Task 2: Build another console log message generator
function celebrateStyler() {
fontStyle = “color: tomato; font-size: 50px”;
if (reason == “birthday”) {
console.log(%Happy birthday, fontStyle);
}
else if (reason == “champions”) {
console.log(%cCongrats on the title!, fontStyle);
}
else {
console.log(message, style);
}
}

// Task 3: Run both the consoleStyler and the celebrateStyler functions
consoleStyler('#1d5c63', '#ede6db', '40px', 'Congrats!');
celebrateStyler('birthday');
// Task 4: Insert a congratulatory and custom message
function styleAndCelebrate() {
consoleStyler('ef7c8e', 'fae8eo', '30px', 'You made it');
celebrateStyler('champions');
}
// Call styleAndCelebrate

this is it bro i keep getting 0% on the grade

take a look carefully in this line, there is something typo in here

Oh yes, i just changed it to fontSize

it is still wrong even after i changed it

// Task 1: Build a function-based console log message generator
function consoleStyler(color,background,fontSize,txt) {
message = “%c” + txt;
style = color: ${color};
style += background: ${background};
style += font-Size: ${fontSize};
console.log(message,style)
}

// Task 2: Build another console log message generator
function celebrateStyler() {
fontStyle = “color: tomato; font-size: 50px”;
if (reason == "birthday") {
console.log(%Happy birthday, fontStyle);
}
else if (reason == “champions”) {
console.log(%cCongrats on the title!, fontStyle);
}
else {
console.log(message, style);
}
}

// Task 3: Run both the consoleStyler and the celebrateStyler functions
consoleStyler('#1d5c63', '#ede6db', '40px', 'Congrats!');
celebrateStyler('birthday');
// Task 4: Insert a congratulatory and custom message
function styleAndCelebrate() {
consoleStyler('ef7c8e', 'fae8eo', '30px', 'You made it');
celebrateStyler('champions');
}
// Call styleAndCelebrate

i see you didn’t change anything in this task and didn’t change the line that i mention above…

1 Like

I changed the S in fontSize to uppercase