I can't create a true variable in Javascript -


i have code in javascript can't make final part work! if answer red won't show first option! new in javascript little bit confused! can't find mistake!

var myname = prompt("whats name?");  var greeting = function (name) {     alert("hello" + " " + name + "!"); };  greeting(myname);  var askfavcolor = prompt("whats favorite color" + " " + myname + "?");  var red = true;  if (askfavcolor === red) {     alert("really that's mine too!!"); } else {     alert("mine blue" + " " + myname); } 

that's thing asked for.

var myname = prompt("whats name?");  var greeting = function (name) {     alert("hello" + " " + name + "!"); };  greeting(myname);  var askfavcolor = prompt("whats favorite color" + " " + myname + "?");  var red = "red";  if (askfavcolor === red) {     alert("realy thats mine to!!"); } else {     alert("mine blue" + " " + myname); } 

Comments