"You should not use the assignment operator." what should I do with that? where is the assignment operator

Tell us what’s happening:
Describe your issue in detail here.

Your code so far


var myVar = 87;

// Only change code below this line
myVar = myVar + 1;
"myVar++";

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36

Challenge: Increment a Number with JavaScript

Link to the challenge:

first of all answer to your question
what is an assignment operator ?
= is assignment operator
example :
var a = 10 ; // here i assign 10 to a variable, which means now a has value of 10,
so here = is assignment operator.

now from your code

you have assigned 87 to myVar using = which is assignment operator.

about your challenge
hint => you have to increase value of myvar using ++ operator

now try to solve your code by yourself and have question feel free to ask

1 Like

You’re supposed to change this line of code.

This is the assignment operator:

=

This is a string:

Anything you put in quotation marks is a string. So with "myVar++" you’ve just written something in the code that is just literal text. Not code. You could have written "hello" and it would have the same effect, it’s not doing anything.

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