Getting stuck on using the .toUpperCase() can anyone tell me what I'm doing with my code so far

Hi Guys,

I was wondering if you can check out why my code shows up on an error in my console whenever I try to make my answerOne all in upper caps.

The idea of the project was to ask five questions and give the test taker a ranking based on the number of items they correctly guess.

let correct = 0;

let rank = '';

 const main= document.querySelector('main').innerHTML;

const answerOne= prompt("Who is Nicos favorite pet?");
if ( answerOne.toUpperCase() = 'NICO'){
  correct + 1;

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

what error are you getting?

Thank you very much ilenia!

Thank you very much RandellDawson. I have just been trying to go along the project line per line, but I just seem to have been stuck in this area.

Ah yes, i believe I certain failed to put the === operator.

= is equal to
== is loosely equal to
=== is strictly equal to

Uncaught ReferenceError: cannot assign to function call

This is because you had the = confused with the ===.

Thank you very much, you were completely right! Man, Learning Javascript is very challenging but it’s amazing. I finished the legacy responsive web design program but now tackling javascript. Thank you for your input RandellDawson.

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