When to while and when to for infinite loop,


for(var i = 0; i <11; i++){
var t = 0
while(t = 1){
console.log("Why won't this stupid goddamn thing work!?!?!?")

This is my code. I'm getting a infinite loop over and over and over again even though the while condition is never even met.


You are assigning t to 1. You compare with ==.