## Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

### Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today. # Could someone look at my code? I didn't move my let's to the top because that broke the program for some reason.

My program is somewhat different because this is my second program, the first one was the same as his and worked but I wanted to try it like this and I can't get the if statements to even register for some reason.... Thanks!

```alert("Let's do some math!");

let numberA = prompt("Pick a number.");
numberA = parseFloat(numberA);
console.log(numberA);

let numberB = prompt("Pick a number.");
numberB = parseFloat(numberB);
console.log(numberB);

if ( isNaN(numberB) ) {

alert("I cannot divide by 0, Please reload and try again!")

}

else if ( numberA != numberA || numberB != numberB ) {

}

else {

let numberAdd = numberA + numberB;
let numberMult = numberA * numberB;
console.log(numberMult);
let numberSubt = numberA - numberB;
console.log(numberSubt);
let numberDiv = numberA / numberB;
console.log(numberDiv);

message = `<h1>"Math with the numbers \${numberA} and \${numberB}</h1>
<br>\${numberA} + \${numberB} = \${numberAdd}
<br>\${numberA} * \${numberB} = \${numberMult}
<br>\${numberA} - \${numberB} = \${numberSubt}
<br>\${numberA} / \${numberB} = \${numberDiv}
`;

document.write(message);

}
``` MOD

Nice job for your second program Kimberly. I formatted your code so it was easier to read. I'm not sure what you are trying to do in the 'if' statements. 'isnan' checks if its not a number. So that works. Not sure what you are trying to check in the else. numberA will always equal numberA. So numberA != numberA will always be false.

If you want to check for 0 you just need

```if (numberB == 0) {

}
``` I was checking for 0 in the first if and letters in the second if. I was reading MDN at the following link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN under "Confusing and Special Case Behavior" which made me think that I should write it the way that I did. I will go back to the if (numberB === 0) and else if ( isNaN(numberA) || isNaN(numberB)). I was just trying to figure it all out as if I hadn't watched the video... Thanks!! MOD

Awesome! OK so you taught me something here. For the special cases you need to use Number.isNaN() or

```numberA = Number(numberA);

if ( numberA != numberA) { 