JavaScript Fundamentals Every Beginner Should Master
Variables, functions, arrays, objects, and the DOM — the plain JavaScript every framework is built on top of.
ES6 (2015) and the yearly releases since have quietly replaced a lot of "clever" old JavaScript patterns with plain, readable syntax. If your code still looks like 2014 jQuery-era JS, these are the features worth adopting first.
const name = 'Bikesh';
console.log(`Hello, ${name}! You have ${5 + 3} new messages.`);
No more string concatenation with + — and multi-line strings work without escape characters.
function greet({ name, role = 'Developer' } = {}) {
return `${name} works as a ${role}`;
}
Pull exactly the properties you need out of an object argument, with sensible fallbacks, in the function signature itself.
const base = { a: 1, b: 2 };
const merged = { ...base, c: 3 }; // { a: 1, b: 2, c: 3 } — new object, base untouched
function sum(...nums) {
return nums.reduce((a, b) => a + b, 0);
}
const city = user?.address?.city ?? 'Unknown';
Without ?., accessing address.city on a user with no address throws immediately. Without ??, a falsy-but-valid value like 0 or an empty string would incorrectly fall back to the default — ?? only falls back on null/undefined.
// utils.js
export function formatDate(date) { /* ... */ }
// app.js
import { formatDate } from './utils.js';
This is what every modern build tool (Vite, Webpack, Next.js) expects — no more manually managing <script> tag order.
Array.at(-1) — get the last item without arr[arr.length - 1]Object.entries(obj) — loop over key-value pairs directlystructuredClone(obj) — a real deep clone, no JSON.parse/stringify hack neededNone of this is exotic — it's just JavaScript as it's actually written today, and it's exactly what you'll see the moment you open a modern React or Next.js codebase.
Variables, functions, arrays, objects, and the DOM — the plain JavaScript every framework is built on top of.
How Promises actually work, why async/await is just readable syntax on top of them, and the parallel-fetching mistake almost everyone makes.
A practical walkthrough of useState, useEffect, useRef, and useContext — the hooks that cover the majority of real React component logic.