Unexpected string


#1

var user = prompt("what your choose for weapon tell me, (shotgun), (sniper), (rifle), (smg) or (pistol)").toLowerCase();

switch(user){
case 'shotgun':
var sgExpert = prompt("are you expert in shotgun(y/n)").toLowerCase();
var stable = prompt("do you have stable hand(y/n)").toLowerCase();

if (sgExpert === 'y' && stable === 'y'){
console.log("wow it suitable with you, you can support each other");
}
else{
    console.log("maybe you can choose any other weapon");
}
break;

case 'sniper':
var steady = prompt("do you have steady hand to use it(y/n)").toLowerCase();
var silencer = prompt("do you have sniper silencer with you(y/n)").toLowerCase();
var quiet = prompt("whether you're quiet enough to use the sniper(y/n)").toLowerCase()

if(steady === 'y' || silencer === 'y' && quiet === 'y'){
console.log("this good to shot from a distance, good choice")
}
else{
    console.log("maybe you can choose rifle or smg");
}
break;

case 'rifle':
var strong = prompt("are you strong(y/n)").toLowerCase();
var scope = prompt("scope so important to see enemy, do you have it(y/n)").toLowerCase();

if(strong === 'y' && scope 'y'){
console.log("this weapon suitable for headliner, plus scope");
}
else{
    console.log("maybe you can play another weapon, LOL")
}
break;

case 'smg':
var bullet = prompt("Do you have enough bullet(y/n)").toLowerCase();
var fast = prompt("do you fast to use this(y/n)").toLowerCase();

if ( bullet === 'y' && fast === 'y'){
console.log("you can use this, and dont spam")
}
else{
    console.log("last weapon pistol")
}
break;

case 'pistol':
console.log("this you can bundle with shotgun, rifle, smg and sniper")
break;

default:
console.log("i dont know what kind of that weapon")

#2

please help me, with this code, idont know where is the problem


#3

this line

if(strong === 'y' && scope 'y'){

should be

if(strong === 'y' && scope=== 'y'){

also add a closing brace } at the end of your code


#4

oh, thanks i forget about it