varoables 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 can't be reassignedvar oneVariable = 22;
var twoVariable = 24;
if (oneVariable != twoVariable){
var same = 2;
if (oneVariable + same){
cosnole.log("oneVariable it's same than twoVariable")
}
} else {
var help = 1;
(oneVariable + help) {
console.log("oneVarible is more big than twoVarible")
}
}// let & var are both editable variables:
var cow = 'moo';
let pig = 'oink';
cow = 10;
pig = 10;
// const is a permanent variable; you cannot change it.
const uncuttableGrass = '\/\/';
uncuttableGrass = '___';
// above throws an error
Also in JavaScript:
- ignore all node_modules
- destruction in javascript
- node list files in directory
- javascript lowercase
- core.js:13987 'mat-date-range-input' is not a known element
- javascript get sum array values
- eslint ignore current line
- javascript scp in to array
- Exception in thread "main" org.openqa.selenium.JavascriptException: cannot read getPlayerState
- return value from fetch javascript
- javascript get all elements with class
- how to reference the bot joining a server in discord.js
- async iife
- js get mouseclick
- javascript how to check if object property exists
- pick random string from array javascript
- jquery remove multiple classes
- assign this value or if it is undefined this other value javascript
- setimmediate vs settimeout
- javascript fromEntries
- fetch api react
- node js colors
- reactjs and webpack tutorial
- Limit text to specified number of words using Javascript