JavaScript Mastery

Variables

let x = 5;
const y = "hello";

Functions

function greet(name) {
  return "Hi " + name;
}

Arrow Functions

const add = (a, b) => a + b;

Console Log

console.log("Hello World");

Conditionals

if (x > 10) { ... } else { ... }

Loops

for (let i = 0; i < 5; i++) { ... }
while (x < 10) { ... }

Arrays

const arr = [1, 2, 3];
arr.push(4);

Objects

const obj = { name: "Aizen", age: 25 };

Array Methods

arr.map(x => x * 2);
arr.filter(x => x > 1);

Template Literals

const msg = `Hello, ${'{'}name{'}'}!`;

Events

button.addEventListener("click", fn);

DOM Selectors

document.getElementById("id");
document.querySelector(".class");

Anime Tip!

Use console.log() to debug like a ninja!