Answers for "how set new data to a variable js"

0

how to store variable in javascript

var example1 = "hello this is string variable" ; //this is string variable
var example2 = 12345 ; //this is numeric variable
var example3 = true ; //boolean variable
Posted by: Guest on November-15-2020
1

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 "how set new data to a variable js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language