how to change a variables value in javascript

JavaScript
var variable = 10;

function start() {
  variable = 20;
}
console.log(variable + 20);

// Answer will be 40 since the variable was changed in the functiona variable is a something that holds a value.. ex: var age = 22; //the age is the variable that holds the value of two. We tell JS that it's a variable by using either var, let, or const
Source

Also in JavaScript: