My own code

what is wrong with this code? (the infinite loop is there on purpose):

console.log(“this code was started on 1/15/2016”)
console.log(“this code is one time only, in order to make that true the end of the code breaks this tab of your browser. other tabs are fine. just close this one when you are done are you ready?”)
var go = prompt(“continue? (type anything or exit page)”)
if(go = true) {
console.log(“first a game if you win you can make this code repeat”)
for (var i = 4; i < 5;) {
console.log("bypass successful);
//hi ham

What makes you say that it is wrong? What is the problem?

whenever the code runs it breaks even if go if go = false

if(go = true) {

that’s an assignment operator " = ", what you want to use is a comparrison operator, which is 2 or 3 " == " or " === " equals signs.

Lastly, your for loop is the reason you’re crashing your browser, it’s incomplete.

for (var i = 4; i < 5;) { //Your code
for ( var i = 4 ; i < 5 ; i++ ) { // Correct code

it’s objective is to crash but thanks :slightly_smiling: