In many programming languages the % operator is the modulus, modulo, or remainder operator. To put it simply, it divides the first number by the second number - but instead of giving you that result, it only gives you the remainder instead.

That allows us an easy way to tell if a number is an even multiple of another. If B goes into A evenly then A % B == 0 is true.

This is partially why your second operation doesn't do what you expect. You're performing a modulo operation again. To divide you want to use the / operator. Like A / B. This still wouldn't quite give you want you want though. We're not looking for a percentage (we know what that is already) instead we're looking for the value after reducing it by that amount.

A simple way to figure out how much of something a certain percentage is is to multiply it by that percentage as a decimal. For instance. 100 * 0.75 == 75. Think of 1 as 100 percent. Which makes sense when you think it through with the math: 100% of 100 is 100. 100 * 1.0 == 1000. Thus you can also increase something by 25% by 100 * 1.25 == 125.

So in the challenge we need to remove 75% of the sheep on months divisible by 4. Thus we do:

I tried to do it this way, and it's not even executing the code in the else if block as far as I can tell, and I'm not sure why. I feel like I should be getting the same output this way. What did I do wrong?

Hello! Your logic's just fine. I put in a log statement in the else if just to make sure.

Couldn't see it easily, so checked the top post here, which has the proper output. Saw that you were printing out the 8192 statement at the correct point, so as the error was about that the only other problem it could be was your message's formatting.

Hey, dude.You've got a couple of mistakes, and I've typed them here for you. 1) In your "if" statement you have added a console.log without the letter "n".2) After your else if statement, you must declare the variable, "var rSheep = numSheep / 2;".3)I the same else if statement you need to type this: "numSheep = numSheep - rSheep;" (Do not add the commas)4) In the same else if statement make sure you add rSheep instead of numSheep in your console.log statement.pay attention to these and you're done!Good Luck!