Answers for "add variables in javascript"

1

add variables in javascript

var a = 5;
var b = 2;
var c = a + b;
Posted by: Guest on March-24-2021
0

how to add a variable in js

var x = 5;         // assign the value 5 to x
Posted by: Guest on November-26-2020
0

how to add a variable in js

var x = 5;         // assign the value 5 to x
Posted by: Guest on November-26-2020
0

how to assign variables in javascript

// data from json: resp = {"home": 1, "landmark": 2}
// Method 1: 
// use ` for add variable
url = `workspace/detail/${resp.home}`;
console.log(url) -> // workspace/detail/1
  
// Method 2: 
// use ' and + for concentrace variable
url = 'workspace/detail/' + resp.home;
console.log(url) -> // workspace/detail/1
Posted by: Guest on March-25-2021

Code answers related to "add variables in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language