javascript - Or condition never evaluates to true -


this javascript code runs think doesn't make through "else" statement since doesn't print console...why?

 = 0;     for(var i=1; i<4; i++) {     var crazy = prompt("would marry me?");          if(crazy === "yes"|| "yes") {            console.log("hell ya!");        }      /* when asks "will marry me" , if user says either "no" or      "no", does't print "ok..i'' try again next time". instead, still says "hell ya !" */      else if (crazy ==="no" ||"no") {        console.log("ok..i'll try again next time !");    } } var love = false; {       console.log("nonetheless, love !"); } while(love); 

try this..nice piece of code though.. marriage proposal geeky guy?

i = 0;     for(var i=1; i<4; i++) {     var crazy = prompt("would marry me?");          if(crazy === "yes"|| crazy ==="yes") {            console.log("hell ya!");        }      /* when asks "will marry me" , if user says either "no" or      "no", does't print "ok..i'' try again next time". instead, still says "hell ya !" */      else if (crazy ==="no" ||crazy === "no") {        console.log("ok..i'll try again next time !");    } } var love = false; {       console.log("nonetheless, love !"); } while(love); 

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -