Basic JavaScript - Increment a Number with JavaScript

i do it as mentioned in the video but still there are 2 errors and i don’t understand it

Your code so far

var myVar =+ 87;

myVar++;

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.82

Challenge: Basic JavaScript - Increment a Number with JavaScript

Link to the challenge:

It asks you to only change the bottom line, you have also changed the top line.
var myVar =+ 87; there should be no + sign here

try restarting the step, and only alter the bottom line

help me to solve this

Your code so far

var myVar =+87;

//only change the code below the line
myVar ++;

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 Edg/115.0.1901.188

Challenge: Basic JavaScript - Increment a Number with JavaScript

Link to the challenge:

Please Tell us what’s happening in your own words.

Learning to describe problems is hard, but it is an important part of learning how to code.

Also, the more you say, the more we can help!

you can’t have a space between myVar and the ++

yseterday i post the same query and as per your instructions i change my code but it is doesn’t work

Your code so far

var myVar =+87;

//only change the code below the line
myVar++;

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 Edg/115.0.1901.188

Challenge: Basic JavaScript - Increment a Number with JavaScript

Link to the challenge:

help me to solve this

Your code so far

let a = 3;
let b = 17;
let c = 12;

// Only change code below this line
var a = 9;
a += 10; // Now, 'a' is equal to 19

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 Edg/115.0.1901.188

Challenge: Basic JavaScript - Compound Assignment With Augmented Addition

Link to the challenge:

This is the starter code for this challenge:

let a = 3;
let b = 17;
let c = 12;

// Only change code below this line
a = a + 12;
b = 9 + b;
c = c + 7;

You shouldn’t be trying to redeclare variables, so remove this line.

This is almost correct except that you should be adding 12, not 10. Then you just need to apply the same syntax to the variables b and c.

I would reset the lesson to restore the correct starting code and then modify code where indicated to use compound assignment.

This is not correct. It should be let myVar = 87;. You shouldn’t be modifying this line of code at all, only the line which is indicated below it.

Please Tell us what’s happening in your own words.

Learning to describe problems is hard, but it is an important part of learning how to code.

Also, the more you say, the more we can help!

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