- What is a Variable
- Defining a Variable
____________________________________________________________________________________________________________________________________________
What is a Variable
Defining a Variable
# define your variables
x = 'ruffs'
y = 24
# print variables
print(x)
print(y)
unicorn
24
%%js
// define variables
let x = 'ruffs'; // defines a var, can be updated but not re-declared in the same scope
const u = 24; // defines a block-scoped constant, cannot be updated or re-declared.
var w = ['h', 'i']; // defines a var, can be updated or re-declared. It’s function-scoped
// log variables in console
console.log(x);
console.log(u);
console.log(w);