Can someone explain why this is not logging 'Payment Processed'

const card = 12345678901234;

let cardVerify;

let payment = ${cardVerify};

let adSpace = ‘available’;

let decline = ‘There was a problem with your payment’;

let processor = ‘Payment Processed’;

if (card.length = 14) {return cardVerify = true} else {return cardVerify = false};

if (adSpace === ‘available’ && payment === true) {console.log(processor)}

else {console.log(decline)};

Hi There @ecarsales0126158896

I’ll try giving it a go and get back to you soon :slight_smile:
Is it a personal project or is it one of codecademy’s lessons?

There’s a typo there. You don’t want to use a single = when you are making comparisons.


Just expanding on @irlfede here:

You want to use three equals.

I had the same issue; I went pro for free for 70 days because I have a student email, so I’m going through certain courses, but I have to significantly supplement them with other information or it doesn’t make sense.

I would probably unsubscribe, but to be honest, it’s better than nothing, and I’ll unsubscribe the day it expires.

Not sure if you posted in the correct topic here. Using == or === for a conditional is covered in the Codecademy JS courses, so discussing that in this topic thread doesn’t seem appropriate. Plus, no matter what course you get you will need to use external materials, no course can cover absolutely everything and also still cater to beginners. If you feel the beginner courses are missing something, you can report this via the help section in the course, or you can make a separate question on these forums. Please refrain from posting in old threads unless the information is directly relevant to the post.