Loading Lesson & Contentβ¦
Fetching tutorial explanations & code examples
const id = Symbol("id"); // "id" is just a description (label)
const user = { [id]: 123, name: "Asha" };
user[id]; // 123
const id2 = Symbol("id");
id === id2; // false β every symbol is uniqueA Symbol is a unique, immutable primitive value. Every symbol is distinct β even two with ...
git add file.txt # stage one file
git add src/ # stage a folder
git add . # stage everything changed
git add -p # stage interactively, hunk by hunkGit's staging area is what makes commits precise. You choose exactly which changes go into...
const animal = {
eat() { return "eating"; },
};
const dog = Object.create(animal); // dog's prototype is animal
dog.bark = () => "woof";
dog.bark(); // "woof" (own property)
dog.eat(); // "eating" (found on the prototype)Every JavaScript object has a hidden link to another object β its prototype . This chain i...
function hasCycle(head) {
let slow = head;
let fast = head;
while (fast !== null && fast.next !== null) {
slow = slow.next;
fast = fast.next.next;
if (slow === fast) return true;
}
return false;
}The Fast & Slow Pointer approach uses two pointers moving at different speeds to detect cy...
You explored 4 developer recipes & mental models. Unlock all 982 lessons across 31 developer courses, AI tutoring, and full interview prep.