Can someone please help me check the bug in my eightBall else if statements? THANK YOU

Can someone please help me check below codes. I’m trying to practice the Javascript eightBall if else statements. No matter what the random value is assigned, the answer is always stuck with ‘Good’. What did I do wrong? Thank you so much for those who can help!

let randomNumber = Math.floor(Math.random()*8);
console.log(randomNumber);
if (randomNumber = 0) {
    console.log('Awesome');}
else if (randomNumber = 1) {
    console.log('Good');}
else if (randomNumber = 2) {
    console.log('super');}
else if (randomNumber = 3) {
    console.log('Way to Go');}
else if (randomNumber = 4) {
    console.log('Bad');}
else if (randomNumber = 5) {
  	console.log('Ugh');}
else if (randomNumber = 6) {
    console.log('Haha');}
else {
    console.log('No way');}

Hello, @beta7552072779.

Welcome to the forum.

Consider what the assignment = operator does versus what the comparison === operator does.

3 Likes