# I cannot find the mistake

#1

TypeError: computerChoice is not a function. (In 'computerChoice("scissors")', 'computerChoice' is 0.8550458699464798)

Oops, try again. Your code doesn't look quite right. Check the Hint if you need help!

``````var userChoice = prompt("Do you choose rock, paper or scissors?")
var computerChoice = Math.random()
if (computerChoice >= 0 <= 0.33) {
computerChoice("rock");
} else if (computerChoice >= 0.34 <= 0.66) {
computerChoice("paper");
} else {
computerChoice("scissors");
}
console.log(computerChoice)``````

#2

The Math.random() method will deliver a number with a value
in the range of 0_(included)_ upontill 0.9999_(1 excluded)_.

As you will have to divide the number range form 0_(inclusive)_ to 0,9999_(so 1 excluded)_
into 3 equal partitions
we have to use an if else-if else statement.
The if else-if else skeleton looks like:

``````    if (conditionA) {
//conditionA is true
} else if (conditionB) {
//conditionA is false
//conditionB is true
} else {     // <=== !! Takes NO condition-statements !!
//conditionA is false
//conditionB is false
}``````

following the Instructions the conditions would be:

1. If computerChoice is between 0 and 0.33, make computerChoice equal to "rock".
( 0 <= computerChoice && computerChoice <= 0.33) which we capture at the IF using
( computerChoice <= 0.33)

2. If computerChoice is between 0.34 and 0.66, make computerChoice equal to "paper".
( 0.33 < computerChoice && computerChoice < 0.67) which we capture at the ELSE IF as
( computerChoice < 0.67 )

3. If computerChoice is between 0.67 and 1, make computerChoice equal to "scissors".
( 0.67 <= computerChoice && computerChoice < 1) , you reached the ELSE level
you can asume that computerChoice is greater equal to 0.67,
the ELSE does NOT take a condition, just write your code.

#3

var userChoice = prompt("Do you choose rock, paper or scissors?")
var computerChoice = Math.random()
if (computerChoice <= 0.33) {
computerChoice("rock");
} else if (computerChoice <= 0.66) {
computerChoice("paper");
} else {
computerChoice("scissors");
}
console.log(computerChoice)
TypeError: computerChoice is not a function. (In 'computerChoice("rock")', 'computerChoice' is 0.290182847995311)
I changed the numbers like you said. What is the issue here?

#4

@skghost,
You must assign a string Value
to the variable computerChoice
like

``computerChoice = "rock"``