Create GSwP- 17 of 28

if (10 === 10) {
    console.log("You got a true!");
} 
else {
    console.log("You got a false!");
}

Original code with errors.

//if (10 = 10); {
//    console.log("You got a true!");
//} else {
//    console.log("You got a false!");
//}


// 1st Bug

//After running the code without any changes.

//The following Output is generated:
//"ReferenceError: Invalid left-hand side in assignment"

//and also in a warning dialog box:
//"Oops, try again. Remove the ';' on line 8. Semicolons don't belong after if statements!"


// 2nd Bug

//After running the code without any changes.

//The following Output is generated:
//"ReferenceError: Invalid left-hand side in assignment"

//and also in a warning dialog box:
//"Oops, try again. A single '=' is for assignment and '===' is for comparisons. Change the '=' to '===' in the if statement on line 8."

// "line 8" is the top line.  I changed if (10 = 10) { to (10 === 10)

// After running the code after correcting the 2nd Bug the Output generated is:

// "You got a true!"

// Again, removing the semicolons after the two console.log commands, does not seem to affect the code.


// Computers aren't that smart

//Debugging, checking syntax.


// The computer doesn't worry about extra spaces between words or brackets
// It just cares about the order of where things are placed
// and that you have used the right characters (){}[]"";

// For extra help, a program called a 'linter' is checking your code
// and will put a red 'x' next to the first line that contains errors

//if (10 = 10); {
//    console.log("You got a true!");
//} else {
//    console.log("You got a false!");
//}