Skip to content

Instantly share code, notes, and snippets.

@alexcrist
Created March 1, 2021 18:33
Show Gist options
  • Save alexcrist/a9187fe60c274a867ae3c0c32e39cc82 to your computer and use it in GitHub Desktop.
Save alexcrist/a9187fe60c274a867ae3c0c32e39cc82 to your computer and use it in GitHub Desktop.
'hello world'
"hello world"
123
1.23
-123
false
true
// ==============
let a = 'hello world';
a = 'hello new world';
// ==============
const name = 'Alex';
const templateString = `hello ${name}`;
// ==============
// IF condition THEN do something
// if (condition) {
// do something
// }
// const condition = true;
// if (condition) {
// console.log('condition is true');
// } else {
// console.log('condition is false');
// }
// ==============
// Falsy values
// * ''
// * 0
// * false
// * undefined
// Truthy values
// * 'asdf'
// * 1, -2, 1.1
// * true
const value = 0;
if (value) {
console.log('Value is truthy!');
}
// ==============
const e = 'asdf' === 'asdf';
console.log(e);
// ==============
function myFunction() {
console.log('Hello world');
console.log('Hello new world');
}
function add(number1, number2) {
const sum = number1 + number2;
return sum;
}
console.log(add(10, 20));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment