Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js variables

// 3 ways to create

var mrVariable = 'x'; // You can set it to to a string ( '' ) or no. ( 0 ). It 
// is globally defined

let myVariaible2 = 'y'; // You can set it to string or no. let is block scoped

const myVariable = 'z'; // It is block scoped, can be a string or no. and can't 
//be reassigned
Source by fahadahmad.substack.com #
 
PREVIOUS NEXT
Tagged: #js #variables
ADD COMMENT
Topic
Name
2+9 =