<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Mahmudul Fahim</title>
    <description>The latest articles on Forem by Mahmudul Fahim (@mdfahim18).</description>
    <link>https://forem.com/mdfahim18</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1245456%2F48619532-ba36-45fb-a224-c2ee64b94de3.jpg</url>
      <title>Forem: Mahmudul Fahim</title>
      <link>https://forem.com/mdfahim18</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mdfahim18"/>
    <language>en</language>
    <item>
      <title>🗺️ JavaScript Map, Set, WeakMap &amp; WeakSet — The Complete Guide</title>
      <dc:creator>Mahmudul Fahim</dc:creator>
      <pubDate>Sun, 08 Feb 2026 20:03:36 +0000</pubDate>
      <link>https://forem.com/mdfahim18/javascript-map-set-weakmap-weakset-the-complete-guide-3cgk</link>
      <guid>https://forem.com/mdfahim18/javascript-map-set-weakmap-weakset-the-complete-guide-3cgk</guid>
      <description>&lt;p&gt;If you’re serious about modern JavaScript, you must understand&lt;br&gt;
Map, Set, WeakMap, and WeakSet.&lt;/p&gt;

&lt;p&gt;They solve real problems that Object and Array couldn’t — especially around performance, memory, and data safety.&lt;/p&gt;

&lt;p&gt;🟦 Map()&lt;br&gt;
✅ What is Map?&lt;/p&gt;

&lt;p&gt;Map is a built-in JavaScript data structure that stores key–value pairs, just like objects, but way more powerful.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const user = new Map([
  ['name', 'md fahim'],
  ['age', 22],
  [99, true],
]);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🤔 Why does Map exist?&lt;/p&gt;

&lt;p&gt;Objects had limitations:&lt;/p&gt;

&lt;p&gt;❌ Keys were mostly strings&lt;br&gt;
❌ Order wasn’t guaranteed (older JS)&lt;br&gt;
❌ No easy way to know the size&lt;/p&gt;

&lt;p&gt;Map fixes all of that.&lt;/p&gt;

&lt;p&gt;🔑 Core Map Methods&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Add or update
user.set('country', 'Bangladesh');
user.set('age', 23);

// Get value
user.get('name'); // 'md fahim'
user.get(99);     // true

// Check existence
user.has('email'); // false

// Delete key
user.delete(99);

// Clear all
user.clear();

// Size
user.size;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔁 Looping Through a Map&lt;br&gt;
✅ for...of (BEST)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for (const [key, value] of user) {
  console.log(key, value);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;keys()&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for (const key of user.keys()) {
  console.log(key);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;values()&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for (const value of user.values()) {
  console.log(value);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;entries() (default)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for (const [key, value] of user.entries()) {
  console.log(key, value);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;forEach()&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;user.forEach((value, key) =&amp;gt; {
  console.log(key, value);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;⚠️ Order is (value, key) — opposite of Object&lt;/p&gt;

&lt;p&gt;🧠 Important Rule: Keys Are Compared by Reference&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const obj = { id: 1 };

const map = new Map();
map.set(obj, 'data');

map.get({ id: 1 }); // ❌ undefined
map.get(obj);       // ✅ 'data'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;❌ Common Map Mistakes&lt;br&gt;
❌ Dot notation&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;user.name // ❌
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Correct&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;user.get('name');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;❌ This won’t work&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;user.keys().forEach(); // ❌
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Do this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for (const key of user.keys()) {}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔄 Convert Between Map &amp;amp; Object&lt;br&gt;
Map → Object&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const obj = Object.fromEntries(user);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Object → Map&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const map = new Map(Object.entries(obj));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Map → Array&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log([...map]);
console.log(Array.from(map));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🟩 Set()&lt;br&gt;
✅ What is Set?&lt;/p&gt;

&lt;p&gt;A Set stores unique values only.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const numbers = new Set([1, 2, 3, 3, 4]);
console.log(numbers); // {1,2,3,4}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔑 Core Set Methods&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;set.add(1);
set.has(1);     // true
set.delete(1);
set.clear();
set.size;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔁 Looping a Set&lt;br&gt;
for...of (BEST)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for (const value of set) {
  console.log(value);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;forEach()&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;set.forEach(value =&amp;gt; {
  console.log(value);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;values() / keys()&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;set.values();
set.keys(); // same as values
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🧠 How Set Checks Uniqueness&lt;br&gt;
Primitive values&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;new Set([1, 1, '1']); // {1, '1'}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Objects (REFERENCE-based)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const a = { x: 1 };
const b = { x: 1 };

const set = new Set([a, b]);
console.log(set.size); // 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;❌ Common Set Mistakes&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;set[0]; // ❌ undefined
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✔ Sets are not indexed&lt;/p&gt;

&lt;p&gt;🔥 Real-Life Use Cases&lt;br&gt;
Remove duplicates&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[...new Set([1,2,2,3])];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Fast permission check&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const roles = new Set(['admin', 'editor']);
roles.has('admin');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🟨 WeakMap()&lt;br&gt;
🧠 Mental Model&lt;/p&gt;

&lt;p&gt;“This data belongs to the object.&lt;br&gt;
If the object dies, the data should die too.”&lt;/p&gt;

&lt;p&gt;Rules&lt;/p&gt;

&lt;p&gt;✔ Keys must be objects&lt;br&gt;
✔ Weakly referenced&lt;br&gt;
✔ Auto garbage collection&lt;br&gt;
❌ No iteration&lt;/p&gt;

&lt;p&gt;Example: Private Data&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const privateData = new WeakMap();

class User {
  constructor(name, password) {
    privateData.set(this, { password });
    this.name = name;
  }

  checkPassword(pass) {
    return privateData.get(this).password === pass;
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🧹 Garbage Collection Magic&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let user = { id: 1 };
const wm = new WeakMap();

wm.set(user, 'secret');
user = null; // auto cleanup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🟪 WeakSet()&lt;br&gt;
🧠 Mental Model&lt;/p&gt;

&lt;p&gt;“I just want to know if I’ve seen this object before.”&lt;/p&gt;

&lt;p&gt;Rules&lt;/p&gt;

&lt;p&gt;✔ Objects only&lt;br&gt;
✔ No duplicates&lt;br&gt;
✔ Auto cleanup&lt;br&gt;
❌ No iteration&lt;/p&gt;

&lt;p&gt;Example: Tracking Objects&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const visited = new WeakSet();

function process(obj) {
  if (visited.has(obj)) return;
  visited.add(obj);
  console.log('Processing...');
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>performance</category>
    </item>
    <item>
      <title>Mastering the Fetch API with Real‑Life JavaScript Examples</title>
      <dc:creator>Mahmudul Fahim</dc:creator>
      <pubDate>Sun, 18 Jan 2026 18:37:38 +0000</pubDate>
      <link>https://forem.com/mdfahim18/mastering-the-fetch-api-with-real-life-javascript-examples-eke</link>
      <guid>https://forem.com/mdfahim18/mastering-the-fetch-api-with-real-life-javascript-examples-eke</guid>
      <description>&lt;p&gt;If you’re learning JavaScript seriously, the Fetch API is not optional — it’s a core skill for real-world frontend development.&lt;/p&gt;

&lt;p&gt;In this post, I’ll walk you through everything I practised in one single playground, including:&lt;/p&gt;

&lt;p&gt;GET, POST, PUT, PATCH, DELETE&lt;/p&gt;

&lt;p&gt;Handling JSON responses&lt;/p&gt;

&lt;p&gt;Using URLSearchParams&lt;/p&gt;

&lt;p&gt;Creating reusable requests with new Request()&lt;/p&gt;

&lt;p&gt;Aborting requests with AbortController&lt;/p&gt;

&lt;p&gt;Simulating file downloads&lt;/p&gt;

&lt;p&gt;All examples use the free fake API: &lt;a href="https://jsonplaceholder.typicode.com" rel="noopener noreferrer"&gt;https://jsonplaceholder.typicode.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;1️⃣ Creating a User (POST Request)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;async function createUser(userData) {
const api_url = 'https://jsonplaceholder.typicode.com/users';


const res = await fetch(api_url, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(userData),
});


const data = await res.json();
console.log(data);
}


createUser({
id: crypto.randomUUID(),
name: 'Md Fahim',
email: 'mdfahim@gmail.com',
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔹 Real‑life use: Signup forms, admin dashboards, and adding new records.&lt;/p&gt;

&lt;p&gt;⚠️ JSONPlaceholder does NOT save data — it only simulates a response.&lt;/p&gt;

&lt;p&gt;2️⃣ Fetch Users With Related Data (URLSearchParams)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;async function fetchUsersWithPosts() {
const api_url = 'https://jsonplaceholder.typicode.com/users';


const queryParams = { _embed: 'posts' };
const queryString = new URLSearchParams(queryParams).toString();


const res = await fetch(`${api_url}?${queryString}`);
const data = await res.json();
console.log(data);
}


fetchUsersWithPosts();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🧠 What is URLSearchParams?&lt;/p&gt;

&lt;p&gt;It converts an object into a valid query string:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{ _embed: 'posts' } → _embed=posts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔹 Real‑life use: Filtering, pagination, sorting, embedding relations.&lt;/p&gt;

&lt;p&gt;3️⃣ Updating Data (PUT vs PATCH)&lt;br&gt;
PUT (Replace Entire Object)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;async function putUser(data) {
const res = await fetch('https://jsonplaceholder.typicode.com/users/1', {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data),
});


console.log(await res.json());
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;PATCH (Partial Update – Recommended)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;async function patchUser(data) {
const res = await fetch(`https://jsonplaceholder.typicode.com/users/${data.id}`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data),
});


console.log(await res.json());
}


patchUser({ id: 3, name: 'Alex Smith' });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔹 Real‑life use: Updating profile info, settings, preferences.&lt;/p&gt;

&lt;p&gt;4️⃣ Deleting a User (DELETE)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;async function deleteUser(userId) {
const res = await fetch(`https://jsonplaceholder.typicode.com/users/${userId}`, {
method: 'DELETE',
});


console.log(await res.json()); // {}
}


deleteUser(5);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Empty object {} is NORMAL for DELETE responses.&lt;/p&gt;

&lt;p&gt;5️⃣ Reusable Requests with new Request()&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;async function adminDashboard(request) {
const res = await fetch(request);
const data = await res.json();
console.log(data);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create Request&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const addUser = new Request('https://jsonplaceholder.typicode.com/users', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ name: 'Hamza Chy', email: 'hamza@gmail.com' }),
});


adminDashboard(addUser);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Update Request&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const updateUser = new Request('https://jsonplaceholder.typicode.com/users/11', {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ name: 'Hamza Chowdhury' }),
});


adminDashboard(updateUser);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Delete Request&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const deleteUser11 = new Request('https://jsonplaceholder.typicode.com/users/11', {
method: 'DELETE',
});


adminDashboard(deleteUser11);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔹 Why use new Request()?&lt;/p&gt;

&lt;p&gt;Cleaner architecture&lt;/p&gt;

&lt;p&gt;Reusable requests&lt;/p&gt;

&lt;p&gt;Middleware‑style patterns&lt;/p&gt;

&lt;p&gt;Better for large apps&lt;/p&gt;

&lt;p&gt;6️⃣ Aborting Requests with AbortController&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

async function downloadFile() {
controller = new AbortController();


const res = await fetch('./download/file.txt', {
signal: controller.signal,
});


const blob = await res.blob();
const url = URL.createObjectURL(blob);


const a = document.createElement('a');
a.href = url;
a.download = 'file.txt';
a.click();


URL.revokeObjectURL(url);
}


function abortDownload() {
controller.abort('User cancelled download');
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔹 Real‑life use:&lt;/p&gt;

&lt;p&gt;Cancel search requests&lt;/p&gt;

&lt;p&gt;Stop downloads&lt;/p&gt;

&lt;p&gt;Prevent race conditions&lt;/p&gt;

</description>
      <category>programming</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>api</category>
    </item>
    <item>
      <title>🚀 Chrome DevTools Guide for Developers</title>
      <dc:creator>Mahmudul Fahim</dc:creator>
      <pubDate>Sat, 23 Aug 2025 12:33:45 +0000</pubDate>
      <link>https://forem.com/mdfahim18/chrome-devtools-guide-for-developers-232c</link>
      <guid>https://forem.com/mdfahim18/chrome-devtools-guide-for-developers-232c</guid>
      <description>&lt;p&gt;Chrome DevTools is a powerful set of tools built into the Chrome browser that helps developers debug, analyze, and optimize web applications. Here’s a guide to its most essential panels and features.&lt;/p&gt;

&lt;p&gt;📌 1. Console&lt;/p&gt;

&lt;p&gt;The Console is your playground for debugging JavaScript.&lt;/p&gt;

&lt;p&gt;console.log() → Print values for debugging.&lt;/p&gt;

&lt;p&gt;console.error() → Show error messages.&lt;/p&gt;

&lt;p&gt;console.warn() → Highlight warnings.&lt;/p&gt;

&lt;p&gt;console.table() → Display data in a clean table.&lt;/p&gt;

&lt;p&gt;Live JavaScript execution: run commands directly in the console.&lt;/p&gt;

&lt;p&gt;👉 Tip: Use shortcuts like $_ (last evaluated result) and $0 (currently selected DOM element).&lt;/p&gt;

&lt;p&gt;📌 2. Elements&lt;/p&gt;

&lt;p&gt;The Elements panel lets you inspect and modify the DOM and CSS in real time.&lt;/p&gt;

&lt;p&gt;Inspect HTML elements (Right click → Inspect).&lt;/p&gt;

&lt;p&gt;Edit attributes, styles, and test design changes instantly.&lt;/p&gt;

&lt;p&gt;See box model details (margin, padding, border).&lt;/p&gt;

&lt;p&gt;Hover elements to highlight them visually on the page.&lt;/p&gt;

&lt;p&gt;👉 Tip: Use the device toolbar (📱 icon) to test responsive design.&lt;/p&gt;

&lt;p&gt;📌 3. Sources&lt;/p&gt;

&lt;p&gt;The Sources panel is your in-browser code editor and debugger.&lt;/p&gt;

&lt;p&gt;Browse loaded JavaScript, CSS, and images.&lt;/p&gt;

&lt;p&gt;Set breakpoints to pause code execution.&lt;/p&gt;

&lt;p&gt;Step through code line by line.&lt;/p&gt;

&lt;p&gt;Watch expressions and inspect call stacks.&lt;/p&gt;

&lt;p&gt;👉 Tip: You can add Workspaces to directly map and edit your local project files.&lt;/p&gt;

&lt;p&gt;📌 4. Workspace&lt;/p&gt;

&lt;p&gt;Workspaces allow you to connect local project files to Chrome DevTools.&lt;/p&gt;

&lt;p&gt;Save changes made in DevTools directly to your project.&lt;/p&gt;

&lt;p&gt;Create custom snippets for reusable debugging code.&lt;/p&gt;

&lt;p&gt;Sync your development workflow without leaving the browser.&lt;/p&gt;

&lt;p&gt;📌 5. Network&lt;/p&gt;

&lt;p&gt;The Network tab helps you analyze requests and responses.&lt;/p&gt;

&lt;p&gt;Monitor API requests (XHR/fetch).&lt;/p&gt;

&lt;p&gt;Check status codes, headers, and payloads.&lt;/p&gt;

&lt;p&gt;Measure loading times and bottlenecks.&lt;/p&gt;

&lt;p&gt;Simulate slow 3G/4G networks for performance testing.&lt;/p&gt;

&lt;p&gt;👉 Tip: Right-click → Copy as cURL to replicate API calls.&lt;/p&gt;

&lt;p&gt;📌 6. Performance&lt;/p&gt;

&lt;p&gt;The Performance panel lets you profile runtime and page load.&lt;/p&gt;

&lt;p&gt;Record and analyze page performance.&lt;/p&gt;

&lt;p&gt;See scripting, rendering, and painting timelines.&lt;/p&gt;

&lt;p&gt;Identify layout shifts and long tasks.&lt;/p&gt;

&lt;p&gt;Optimize JavaScript execution and rendering.&lt;/p&gt;

&lt;p&gt;👉 Tip: Use Lighthouse (Audits tab) for automated performance, accessibility, and SEO insights.&lt;/p&gt;

&lt;p&gt;🎯 Conclusion&lt;/p&gt;

&lt;p&gt;Mastering Chrome DevTools makes you a 10x developer — debugging faster, optimizing smarter, and building with confidence. Start small (console + elements) and grow into advanced tools (network, performance).&lt;/p&gt;

&lt;p&gt;💡 Remember: The best developers don’t just code — they inspect, test, and optimize.&lt;/p&gt;

</description>
      <category>programming</category>
    </item>
    <item>
      <title>JS includes(), slice(), concat(), trim(), split() string methods.</title>
      <dc:creator>Mahmudul Fahim</dc:creator>
      <pubDate>Fri, 11 Apr 2025 21:12:03 +0000</pubDate>
      <link>https://forem.com/mdfahim18/js-includes-slice-concat-trim-split-string-methods-4kk5</link>
      <guid>https://forem.com/mdfahim18/js-includes-slice-concat-trim-split-string-methods-4kk5</guid>
      <description>&lt;h2&gt;
  
  
  includes():
&lt;/h2&gt;

&lt;p&gt;method returns true if a string contains a specified string. Otherwise, it returns false. The includes() method is case-sensitive.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let text = "Hello world, welcome to the universe.";
text.includes('world') // true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  slice():
&lt;/h2&gt;

&lt;p&gt;extracts a part of a string. return the extracted part in a new string. doesn’t change the original string. The start and end parameters specify the part of the string to be extracted. position index starts with 0. A negative number is selected from the end.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let txt = 'Hello world';
txt.slice(0, 5) // 'Hello'
txt.slice(7,10) // 'orl'
txt.slice(-1) // 'd'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  concat():
&lt;/h2&gt;

&lt;p&gt;method is used to combine two or more strings into one single new string. It does not modify the original strings. It returns a new string containing the text of the joined strings.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const str1 = 'Hello';
const str2 = 'World';

console.log(str1.concat(' ', str2)) // Hello World
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  trim():
&lt;/h2&gt;

&lt;p&gt;method removes whitespace from both ends of a string.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const txt = '    hello world    ';
txt.trim() // 'hello world'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  split():
&lt;/h2&gt;

&lt;p&gt;method divides a string into an array of substrings based on a specified separator (like space, comma, etc.)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Returns a new Array.&lt;/li&gt;
&lt;li&gt;Doesn’t change the original array.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const txt = 'Hello World';
txt.split('') // ['H', 'e', 'l', 'l', ' ', 'W', 'o', 'l', 'd']
txt.split(' ') // ['Hello', 'World']
txt.split('o') // ['Hell', ' W', 'rld']
const txt2 = 'apple, banana, orange';
txt2.split(',', 2); // ['apple', 'banana']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>JS Object.freeze(), Object.seal() methods</title>
      <dc:creator>Mahmudul Fahim</dc:creator>
      <pubDate>Wed, 02 Apr 2025 20:06:13 +0000</pubDate>
      <link>https://forem.com/mdfahim18/js-objectfreeze-objectseal-methods-6mp</link>
      <guid>https://forem.com/mdfahim18/js-objectfreeze-objectseal-methods-6mp</guid>
      <description>&lt;h2&gt;
  
  
  Object.freeze()
&lt;/h2&gt;

&lt;p&gt;is a method that prevents modifications to an object. Once an object is frozen.&lt;/p&gt;

&lt;p&gt;✅ You cannot add new properties.&lt;br&gt;
✅ You cannot modify existing properties.&lt;br&gt;
✅ You cannot delete properties.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const user = {
  name: "Alice",
  age: 25
};

Object.freeze(user);

user.age = 30;  // ❌ Won't change
user.city = "New York"; // ❌ Won't add
delete user.name; // ❌ Won't delete

console.log(user); 

// output: { name: "Alice", age: 25 }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 It only works on the first level. It does not freeze nested objects.&lt;/p&gt;

&lt;h2&gt;
  
  
  Object.seal()
&lt;/h2&gt;

&lt;p&gt;is a method that prevents adding or deleting properties from an object but allows modification of existing properties.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const user = {
  name: "Alice",
  age: 25
};

Object.seal(user);

user.age = 30;  // ✅ Allowed (modification works)
user.city = "New York"; // ❌ Not allowed (new property won't be added)
delete user.name; // ❌ Not allowed (deletion won't work)

console.log(user); 

// output: { name: "Alice", age: 30 }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📌 Summary:&lt;/p&gt;

&lt;p&gt;Feature Object.seal() | Object.freeze()&lt;br&gt;
Modify properties = ✅ Yes ❌ No&lt;br&gt;
Add new properties = ❌ No ❌ No&lt;br&gt;
Delete properties = ❌ No ❌ No&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>JS Object.assign(), Object.create(). Object.defineProperties() Methods.</title>
      <dc:creator>Mahmudul Fahim</dc:creator>
      <pubDate>Thu, 27 Mar 2025 20:25:12 +0000</pubDate>
      <link>https://forem.com/mdfahim18/js-objectassign-objectcreate-objectdefineproperties-methods-50n0</link>
      <guid>https://forem.com/mdfahim18/js-objectassign-objectcreate-objectdefineproperties-methods-50n0</guid>
      <description>&lt;h2&gt;
  
  
  Object.assign() -
&lt;/h2&gt;

&lt;p&gt;The Object.assign() method copies properties from one or more source objects to a target object.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const obj1 = { a: 1, b: 2 };
const obj2 = { c: 3, d: 4 };

console.log(obj1, obj2)

// output: 1, 3, 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Object.create() -
&lt;/h2&gt;

&lt;p&gt;creates an object from an existing object. is a method in JavaScript that creates a new object, setting the prototype of the new object to an existing object. This allows the new object to inherit properties and methods from the prototype object.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const person = {
    greet: function(){
        console.log(`Hello my name is ${this.name}`);
    }
}

const john = Object.create(person);
john.name = 'John';
john.greet()

// Hello my name is John    
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Object.create() -
&lt;/h2&gt;

&lt;p&gt;is a JavaScript method that allows you to define multiple properties on an object at once. You can specify each property's characteristics, such as whether it's writable, enumerable, or configurable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const user = {};

Object.defineProperties(user, {
firstName: {
    value: 'John',
    writable: true, // Can be modified
    enumerable: true, // Will appear in loops
    configurable: true, // Can be deleted or change
    },
    age: {
    Value: 30,
    writable: false, // Cannot be modified
    enumerable: true, // Will appear in loops
    configurable: false, // Cannot be deleted or changed
    },
})

user.firstName = 'Alex' // output: Alex
user.age = 23 // output 30  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Redid my Javascript projects</title>
      <dc:creator>Mahmudul Fahim</dc:creator>
      <pubDate>Fri, 21 Feb 2025 19:29:18 +0000</pubDate>
      <link>https://forem.com/mdfahim18/redid-my-javascript-projects-2go4</link>
      <guid>https://forem.com/mdfahim18/redid-my-javascript-projects-2go4</guid>
      <description>&lt;p&gt;I just finished polishing up some of my JavaScript projects and cleaned up the code. Would love your feedback :)&lt;br&gt;
Live site: &lt;a href="https://mdfahim18.github.io/all-raw-js-projects/" rel="noopener noreferrer"&gt;https://mdfahim18.github.io/all-raw-js-projects/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flbhoqkcogmke4zfgrax9.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flbhoqkcogmke4zfgrax9.jpg" alt="Image description" width="800" height="368"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>frontend</category>
      <category>programming</category>
    </item>
    <item>
      <title>suggest me a react portfolio project</title>
      <dc:creator>Mahmudul Fahim</dc:creator>
      <pubDate>Mon, 01 Jan 2024 16:12:06 +0000</pubDate>
      <link>https://forem.com/mdfahim18/suggest-me-a-react-portfolio-project-54c7</link>
      <guid>https://forem.com/mdfahim18/suggest-me-a-react-portfolio-project-54c7</guid>
      <description>&lt;p&gt;I want to create a React portfolio project where I can add all my projects. Which will be very beautiful and unique. Suggest this kind of project with site link if you know. Thank you&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>sass</category>
      <category>css</category>
    </item>
  </channel>
</rss>
