#i need help in js my code is not working right
38 messages · Page 1 of 1 (latest)
You're using assignment operator (=)
yes
if (day = 12) assigns day variable with the integer 12 as the value
It'll error for the day variable not existing after you do that change
bro could u pz tye the code
var age = 24;
if (day = 12) {
console.log('good day');
}
What do you want the code to do?
The code there is just the code you had in your screenshot, I just copied it and got it into a codeblock
The code isn't doing what you want, but what would you want the code to do?
Don't know how to help you if I don't know what you'd want the code to do
im sorry for sking to much
I'll try my best to help you understand what you need to do, and what you need to learn to do what you want to do once I know what that is
so i just have to past it now
Hm?
I didn't fix anything
It's the code you had to begin with
What do you want the code to do?
So the code is
var age = 24;
if (day == 12) {
console.log('good day');
}
Or?
Your code doesn't have a variable named day
So, what you have there won't ever print the good day
broooooo
What are you trying to do with the code?
why im havung a eoorr