Computer Choice: Part 2


#1


Build "Rock Paper Scissors"
Computer Choice: Part 2


Why are we not using the && operator?


if (computerChoice <= 0.33) {
console.log("rock");
}
else if (computerChoice >= 0.34 && computerChoice <= 0.66) {
console.log("paper");
}
else {
console.log("scissors");
}


#2

@tmhendrickson,
How would you want to use the && operator in this case


#3

i guess it's from learning that && operators will give us a range.


#4

@chipwhiz72717, @tmhendrickson
The &&-operator is the AND operator and is one of the logicaloperators......
Have a look at
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.