javascript
// Basic event listener
const button = document.getElementById('myButton');

button.addEventListener('click', function(event) {
  console.log('Button clicked!');
  console.log('Event type:', event.type);

Event handling and event delegation patterns in JavaScript

javascript events event-delegation
by Alex Chang 1 tab
javascript
// Array destructuring
const numbers = [1, 2, 3, 4, 5];
const [first, second] = numbers;
console.log(first, second); // 1 2

// Skip elements

ES6+ features: destructuring, spread operator, and template literals

javascript es6 destructuring
by Alex Chang 1 tab
javascript
// Sample data
const numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const users = [
  { id: 1, name: 'Alice', age: 25, active: true },
  { id: 2, name: 'Bob', age: 30, active: false },
  { id: 3, name: 'Charlie', age: 35, active: true },

Array methods: map, filter, reduce, and functional programming

javascript arrays functional-programming
by Alex Chang 1 tab
javascript
// Creating a Promise
const myPromise = new Promise((resolve, reject) => {
  const success = true;

  setTimeout(() => {
    if (success) {

Promises and async/await patterns for asynchronous JavaScript

javascript promises async-await
by Alex Chang 1 tab
javascript
// Basic closure example
function outer() {
  const message = 'Hello from outer';

  function inner() {
    console.log(message); // Accesses outer variable

JavaScript closures and lexical scope fundamentals

javascript closures scope
by Alex Chang 1 tab
css
/* BEM - Block Element Modifier */

/* BLOCK - Independent component */
.card {
  padding: 1rem;
  border: 1px solid #ddd;

CSS architecture patterns: BEM and utility-first approaches

css architecture bem
by Alex Chang 2 tabs
css
/* Container Queries */
.card-container {
  container-type: inline-size; /* Creates query container */
  container-name: card;
}

Modern CSS features: container queries and :has() selector

css container-queries has-selector
by Alex Chang 1 tab
css
/* Interactive pseudo-classes */
a:link { color: blue; }
a:visited { color: purple; }
a:hover { text-decoration: underline; }
a:active { color: red; }
a:focus { outline: 2px solid orange; }

CSS pseudo-classes and pseudo-elements for advanced styling

css pseudo-classes pseudo-elements
by Alex Chang 2 tabs
css
/* Basic transitions */
.button {
  background-color: blue;
  color: white;
  padding: 1rem 2rem;
  transition: background-color 0.3s ease;

CSS animations and transitions for smooth interactions

css animations transitions
by Alex Chang 1 tab
javascript
// Theme switching with CSS variables
const themeToggle = document.getElementById('theme-toggle');
const root = document.documentElement;

// Load saved theme
const savedTheme = localStorage.getItem('theme') || 'light';

CSS custom properties (CSS variables) for dynamic theming

css variables custom-properties
by Alex Chang 2 tabs
css
/* Mobile-first base styles (no media query needed) */
.container {
  width: 100%;
  padding: 1rem;
  margin: 0 auto;
}

Responsive design with media queries and mobile-first approach

css responsive media-queries
by Alex Chang 1 tab
css
/* Specificity: 0,0,0,1 - Element selector */
p {
  color: black;
}

/* Specificity: 0,0,1,0 - Class selector */

CSS selectors and specificity calculation rules

css selectors specificity
by Alex Chang 1 tab