Answers for "how to create variables using javascript"

41

javascript declare a variable

//choose the best for your solution
var myVariable = 22; //this can be a string or number. var is globally defined

let myVariable = 22; //this can be a string or number. let is block scoped

const myVariable = 22; //this can be a string or number. const is block scoped and can't be reassigned
Posted by: Guest on March-09-2020
3

how to write a variable in js

//choose the best for your solution
var myVariable = 22; //this can be a string or number. var is globally defined

let myVariable = 22; //this can be a string or number. let is block scoped

const myVariable = 22; //this can be a string or number. const is block scoped and
Posted by: Guest on June-03-2020
1

varianle in javascript

var one = 1; // variable stores numeric value

var two = 'two';  // variable stores string value

var three;  // declared a variable without assigning a value
Posted by: Guest on August-02-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
-1

how to create variables using javascript

var myVar;       //unitialized variable( can be intiallized later )
var number = 1; //number
var string = " hello world " ; //string
var boolean = true ;  //boolean
myVar = function(){  //variable can hold function
  
};
Posted by: Guest on February-09-2021

Code answers related to "how to create variables using javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language