JavaScript Array Includes Indexof and Lastindexof Guide
includes() checks if a value exists. indexOf() finds its first position. lastIndexOf() finds its last. Learn the differences and when to use each method.
Master JavaScript from basics to advanced
includes() checks if a value exists. indexOf() finds its first position. lastIndexOf() finds its last. Learn the differences and when to use each method.
Learn four ways to remove duplicate values from JavaScript arrays: Set, filter, reduce, and forEach. Compare approaches for primitives and objects.
Learn how to create JavaScript objects, work with key-value pairs, and understand why objects are the backbone of almost every JavaScript program.
Learn how to read, update, and safely access JavaScript object properties using dot notation, bracket notation, optional chaining, and dynamic keys.
Learn when to use dot notation vs bracket notation in JavaScript. See the key differences, trade-offs, and real scenarios where each access style shines.
Learn how to add functions as object methods, use the this keyword correctly, write method shorthand, and avoid common this-binding mistakes.
Learn how Object.assign() copies properties between objects. Use it for merging configuration, cloning objects, and setting defaults, while avoiding the shallow copy trap.
Learn how to unpack object properties into variables using JavaScript destructuring. Covers basic syntax, default values, nested objects, and real-world patterns.
Learn how to rename variables while destructuring JavaScript objects using the colon syntax. Avoid name conflicts and assign clearer variable names in one step.
Learn Object.keys(), Object.values(), and Object.entries() to iterate, transform, and inspect JavaScript objects. Practical patterns for real code.
Learn the JavaScript Map object: a key-value collection that accepts any type as a key, preserves insertion order, and outperforms plain objects for frequent data operations.
Learn the JavaScript Set object for storing unique values of any type. Covers add, delete, has, iteration, removing duplicates, and set operations.