Questions about results


#1

Hey guys, i just done the exercise and pass it ok, my problem is the results, i know what i wrote, but the results aren't what i want:

// Write your code below!
for (i = 0; i < 2; i += 0.5) {
console.log("dafuq is this")
}

var cookies = 0;
while (cookies > 6) {
cookies++;
console.log("Where ma cookies brah?")
}
var cookie = 2;
do {
console.log("Dayum good cookies");
cookie++;
} while (cookie < 4);

ok the results were:

dafuq is this
dafuq is this
dafuq is this
dafuq is this (as expected)

/* there should be the "Where ma cookies brah?", why doesn't it appear */

Dayum good cookies
Dayum good cookies
3 ( 3?)

thanks


#2

@arccoder12354,
With your code

var cookies = 0;
while (cookies > 6) {

you first set cookies to the number Value 0
then in your WHILE-condition you test if this cookie variable is =greater than= 0
well that will NOT happen ever........


#3

I see, therefor if i wanted to make some sort of math how would i increment it?


#4

@arccoder12354,
Try using

cookies < 6