add variable to script javascript code example
Example 1: add variables in javascript
var a = 5;
var b = 2;
var c = a + b;
Example 2: how to add a variable in js
var x = 5; // assign the value 5 to x
var a = 5;
var b = 2;
var c = a + b;
var x = 5; // assign the value 5 to x