Question: I need to know the difference between these two statements Wrong one if(d.getMonth()== person.birthday.getMonth()) { document.write(It is your birthday) }else{ document.write(It is not your birthday)

I need to know the difference between these two statements

Wrong one if(d.getMonth()== person.birthday.getMonth()) { document.write("It is your birthday") }else{ document.write("It is not your birthday") }

Explain to me what this is statement doing ( why it is wrong? )

Correct one

if(d.getMonth()== person.birthday.getMonth() && d.getDate()== person.birthday.getDate()) {

document.write("It is your birthday")

}else{

( explain to me what this statement doing )

document.write("It is not your birthday")

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!