What is the code for 4. Computer Choice Part 2


Please paste code i am stuck


@august_kirchoff you have to try writing some code on your own and then why you get errors you cant decipher that's when you come here


here is a question, what are the symbols for in between 0.34 and 0.66? i only know =<, =>, ===, =, and >, and <.


There is no symbol for in between, what you could do is chaining two statements

0.34 < x and 0.66 > x

where the JS operator for and is &&. But the easier way is too think if you really need all of the boundary conditions. e.g. if your first range goes from 0 to 0.33 you already made sure that x must be bigger to even get to this condition.


here is my code; it says "syntaxerror: missing ) after condition" what did i do wrong here is code:
var userChoice = prompt("Rock, Paper, Scissors!");
console.log( computerChoice = Math.random() )
if( computerChoice > 0 and < 0.33) {
computerChoice === "Rock"
} else if(computerChoice > 0.34 and < 0.66 ) {
computerChoice === "Paper"
} else {
computerChoice === "Scissors"


As said in javaScript the and is written by &&. Also < is a binary operator meaning that it needs to values to work on but in your case it sees 0.33 to the right and and to the left so to make this work you at least need to add another computerChoice. The interpreter doesn't understand context that well. Also think about if computerChoice > 0 s really necessary if Math.random() always generates numbers that are 0 or bigger?


Thanks haxor u rock man