Code Your Own Adventure 2! 5/6


#1


I am extremely stuck on this question. It keeps on saying that there is a problem with my syntax

var user = prompt("Do you want to do a cation (not including ammonia), anion (only chloride, bromide and iodine) or flame test?").toUpperCase();

switch(user) {
  case 'FLAME TEST':
   var flameColour = prompt("Clean a platinum wire by dipping it into concentrated hydrochloric acid and then holding it in a hot Bunsen flame.Moisten it again with some of the acid and then dip it into a small amount of the solid you are testing so that some sticks to the wire. Place the wire back in the flame again. Is the flame red, orange-yellow, lilac, or blue green?").toUpperCase();
   if(flameColour = "RED"){
       console.log("Your compound contains lithium")
   }
   if else (flameColour = "LILAC"){
       console.log("Your compound contains potassium")
   }
   else if (flameColour = "BLUE-GREEN"){
       console.log("Your compound contains copper")
   }
   else {
       console.log("Your compound contains sodium")
   }
    break;
  case 'CATION':
    var cationTest = prompt("Add dilute aqueous sodium hydroxide. Is the precipitate pale blue, pale green, red brown, or white?");
     if(cationTest = "PALE BLUE"){
       console.log("Your compound contains copper")
   }
   if else (cationTest = "PALE GREEN"){
       console.log("Your compound contains iron II")
   }
   else if (cationTest = "RED BROWN"){
       console.log("Your compound contains iron III")
   }
   else (cationTest = "WHITE"){
       console.log("Your compound contains either aluminium, zinc or calcium")
   }
   
    break;
 case 'ANION':
    var anionTest = prompt("Add equal dilute nitric acid. Then add aqueous silver nitrate. Is the precipitate white, cream or yellow?");
      if(anionTest = "YELLOW"){
       console.log("Your compound contains iodine")
   }
    if else (anionTest = "CREAM"){
       console.log("Your compound contains bromide")
   }
   else (anionTest = "WHITE"){
       console.log("Your compound contains chloride")
   }
    break;  
    default:
    console.log("That wasn't the wasn't the question.....try again");


#2

Hi inside all your if and else if statement you should change all the = with ===
then you got some if else instead of else if.... and the else statement doesn't take any condition