Web Tools Table Maker3schools TranslateImage CompressorFavicon Icon GeneratorCrop & Resize Image
Apu
Apu February 11, 2023 › #Javascript #Q&A

Which operator is used to assign a value to a variable?

  1. A) ==
  2. B) =
  3. C) +
  4. D) !=

Answer: B) =

Explanation: the = operator is used to assign a value to a variable. This operator takes a value of the right side of the equation and assigns it to the variable on the left side.
For example, if you want to assign the value 20 to the variable y, you need write y = 20.

Example:

<script>
  let y = 20;
  console.log(y);
</script>
save
listen
AI Answer
Write Your Answer
loading
back
View All