#separator:tab
#html:false
#tags column:4
Print to the console	console.log('Hi')		tech-javascript-basics
Declare a changeable variable	let x = 5;		tech-javascript-basics
Declare a constant	const PI = 3.14;		tech-javascript-basics
Old way to declare a variable	var x = 5;		tech-javascript-basics
Single-line comment	// comment		tech-javascript-basics
Strict equality	a === b		tech-javascript-basics
Strict inequality	a !== b		tech-javascript-basics
Logical and	a && b		tech-javascript-basics
Logical or	a || b		tech-javascript-basics
Logical not	!a		tech-javascript-basics
Remainder	7 % 2		tech-javascript-basics
Exponent	2 ** 3		tech-javascript-basics
Increment	i++		tech-javascript-basics
If statement	if (x > 3) { }		tech-javascript-basics
Else if	else if (x === 3) { }		tech-javascript-basics
Ternary operator	cond ? a : b		tech-javascript-basics
Switch statement	switch (x) { case 1: break; }		tech-javascript-basics
For loop	for (let i = 0; i < 5; i++) { }		tech-javascript-basics
For...of loop	for (const item of arr) { }		tech-javascript-basics
For...in loop	for (const key in obj) { }		tech-javascript-basics
While loop	while (x < 10) { }		tech-javascript-basics
Function declaration	function add(a, b) { return a + b; }		tech-javascript-basics
Arrow function	const add = (a, b) => a + b;		tech-javascript-basics
Anonymous function	function () { }		tech-javascript-basics
Make an array	const arr = [1, 2, 3];		tech-javascript-basics
Add to end of array	arr.push(4)		tech-javascript-basics
Remove last item	arr.pop()		tech-javascript-basics
Add to start	arr.unshift(0)		tech-javascript-basics
Remove first item	arr.shift()		tech-javascript-basics
Array length	arr.length		tech-javascript-basics
Loop over each item	arr.forEach(x => ...)		tech-javascript-basics
Transform every item	arr.map(x => x * 2)		tech-javascript-basics
Keep items that pass a test	arr.filter(x => x > 2)		tech-javascript-basics
Combine into one value	arr.reduce((sum, x) => sum + x, 0)		tech-javascript-basics
Find first match	arr.find(x => x > 2)		tech-javascript-basics
Does the array include a value?	arr.includes(3)		tech-javascript-basics
Sort an array (numbers)	arr.sort((a, b) => a - b)		tech-javascript-basics
Join array into a string	arr.join(', ')		tech-javascript-basics
Make an object	const o = { name: 'Sam', age: 9 };		tech-javascript-basics
Read an object property	o.name or o['name']		tech-javascript-basics
Get keys of an object	Object.keys(o)		tech-javascript-basics
Template literal	`Hello ${name}`		tech-javascript-basics
String length	s.length		tech-javascript-basics
String uppercase	s.toUpperCase()		tech-javascript-basics
Split a string	s.split(' ')		tech-javascript-basics
Convert to number	Number('5') or parseInt('5')		tech-javascript-basics
Check not a number	isNaN(x)		tech-javascript-basics
Random number 0 to 1	Math.random()		tech-javascript-basics
Round down	Math.floor(3.7)		tech-javascript-basics
Round	Math.round(3.5)		tech-javascript-basics
Absolute value	Math.abs(-3)		tech-javascript-basics
Larger of values	Math.max(1, 5)		tech-javascript-basics
Undefined	A variable that has not been given a value		tech-javascript-basics
Null	An intentional empty value		tech-javascript-basics
typeof operator	typeof x		tech-javascript-basics
Select an element by ID	document.getElementById('id')		tech-javascript-basics
Select with a CSS selector	document.querySelector('.cls')		tech-javascript-basics
Change text of an element	el.textContent = 'Hi'		tech-javascript-basics
Change style	el.style.color = 'red'		tech-javascript-basics
Add a class	el.classList.add('on')		tech-javascript-basics
Listen for a click	el.addEventListener('click', fn)		tech-javascript-basics
Wait before running code	setTimeout(fn, 1000)		tech-javascript-basics
Repeat code over time	setInterval(fn, 1000)		tech-javascript-basics
Fetch data from a URL	fetch(url)		tech-javascript-basics
Parse JSON text	JSON.parse(text)		tech-javascript-basics
Convert to JSON text	JSON.stringify(obj)		tech-javascript-basics
Promise	An object for a value that will be available later		tech-javascript-basics
async / await	Syntax for writing asynchronous code that reads in order		tech-javascript-basics
Try/catch	try { } catch (e) { }		tech-javascript-basics
Class definition	class Dog { constructor(name) { this.name = name; } }		tech-javascript-basics
this keyword	Refers to the current object		tech-javascript-basics
Import a module	import x from './x.js';		tech-javascript-basics
Export a function	export function f() { }		tech-javascript-basics
Spread operator	[...arr]		tech-javascript-basics
Destructuring	const { a, b } = obj;		tech-javascript-basics
JavaScript's creator	Brendan Eich, in 1995		tech-javascript-basics
Is JavaScript the same as Java?	No, they are different languages		tech-javascript-basics
