JavaScript básico - Incrementar um número com JavaScript

Oi pessoal, estou nesse desafio do Java com myVar, transformando i+1 em i++. Porém, o resultado está dando erro.
Dizendo que não está resultando em 88.
Hi guys, I’m on this Java challenge with myVar, transforming i+1 into i++. However, the result is giving an error.
Saying it’s not resulting in 88.

let myVar = 87;

// Altere apenas o código abaixo desta linha
myVar = myVar++;

Informações de seu navegador:

Agente de usuário: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36

Desafio: JavaScript básico - Incrementar um número com JavaScript

Link para o desafio:

  1. ++ changes the variable value, you do not need to reassign the value back to the variable.
let number = 0;
number++
console.log(number) // 1
  1. The pre and post increment/decrement do not work the same.

Postfix increment

let x = 3;
const y = x++;

// x = 4
// y = 3

Prefix increment

let x = 3;
const y = ++x;

// x = 4
// y = 4
1 Like

Tnksssss
Very fast
S2