Answers for "how to write a variable in js"

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
0

how to create a variable in javascript

// you an pass in strings or a number 

var exampleVariable = 'Example string' // this is a normal string 
var anotherExample = 839;
Posted by: Guest on June-25-2021

Code answers related to "how to write a variable in js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language