[
    {
      "title": "What is IndexedDB",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7448276165661314336",
      "level": "basic",
      "theme": "IndexedDB, db, storage",
      "text": "### What is IndexedDB?\n\nIndexedDB is a low-level API for storing large amounts of structured data, including files and blobs. It allows developers to perform advanced queries and store data persistently in a user's browser. This API is particularly useful for web applications that need to work offline or require local storage beyond simple key-value pairs.",
      "link": "#what-is-indexeddb"
    },
    {
      "title": "What are the options in a cookie",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7448261980567145761",
      "level": "basic",
      "theme": "cookie, options, storage",
      "text": "### What are the options in a cookie?\n\nCookies have several options to control their behavior, such as `path`, `domain`, `secure`, `HttpOnly`, and `SameSite`. These options help define the scope, security, and accessibility of the cookie.",
      "link": "#what-are-the-options-in-a-cookie"
    },
    {
      "title": "Differences between cookie, local storage and session storage",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7448258461030173985",
      "level": "basic",
      "theme": "cookie, local storage, session storage, differences",
      "text": "### Differences between cookie, local storage, and session storage\n\nCookies are primarily used for server communication and have size limitations. Local storage provides persistent client-side storage with no expiration, while session storage stores data for the duration of a session.",
      "link": "#differences-between-cookie-local-storage-and-session-storage"
    },
    {
      "title": "How do you delete a cookie",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7448236859966197025",
      "level": "intermediate",
      "theme": "cookie, delete, remove",
      "text": "### How do you delete a cookie?\n\nTo delete a cookie, set its expiration date to a past date using the `Set-Cookie` header or JavaScript's `document.cookie`. Ensure you match the path and domain attributes of the cookie.",
      "link": "#how-do-you-delete-a-cookie"
    },
    {
      "title": "What is a post message",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7448205399074934049",
      "level": "intermediate",
      "theme": "postMessage, communication, iframe",
      "text": "### What is a post message?\n\nThe `postMessage` API allows secure communication between a parent window and iframes or between different windows. It is commonly used for cross-origin communication in web applications.",
      "link": "#what-is-a-post-message"
    },
    {
      "title": "What are closures",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7447942704148811041",
      "level": "intermediate",
      "theme": "closures, JavaScript, scope",
      "text": "### What are closures?\n\nClosures in JavaScript occur when a function retains access to its lexical scope even after the function in which it was defined has completed execution. They enable powerful programming patterns like encapsulation and callbacks.",
      "link": "#what-are-closures"
    },
    {
      "title": "What are modules",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7447936859029654816",
      "level": "intermediate",
      "theme": "modules, JavaScript, ES6",
      "text": "### What are modules?\n\nModules are reusable blocks of code that can be imported and exported in JavaScript. They help organize and encapsulate functionality, promoting maintainable and modular codebases.",
      "link": "#what-are-modules"
    },
    {
      "title": "What are classes in ES6",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7447909741977685280",
      "level": "advanced",
      "theme": "classes, ES6, object-oriented programming",
      "text": "### What are classes in ES6?\n\nClasses in ES6 provide a syntax for object-oriented programming in JavaScript. They include constructors, methods, and inheritance, making it easier to create and manage objects.",
      "link": "#what-are-classes-in-es6"
    },
    {
      "title": "Why do you need modules",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7447895686626020640",
      "level": "intermediate",
      "theme": "modules, benefits, organization",
      "text": "### Why do you need modules?\n\nModules help organize code into manageable pieces, improve reusability, and avoid global namespace pollution. They also make dependency management and code maintenance easier.",
      "link": "#why-do-you-need-modules"
    },
    {
      "title": "What is Hoisting",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7447882385946938656",
      "level": "basic",
      "theme": "hoisting, JavaScript, scope",
      "text": "### What is Hoisting?\n\nHoisting in JavaScript refers to the process where variable and function declarations are moved to the top of their scope during compilation. This allows variables to be used before they are declared.",
      "link": "#what-is-hoisting"
    },
    {
      "title": "What is scope in javascript",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7447877473280265505",
      "level": "basic",
      "theme": "scope, JavaScript, variables",
      "text": "### What is scope in JavaScript?\\n\\nScope determines the accessibility of variables and functions in JavaScript. There are two types of scope: global and local. Modern JavaScript also includes block scope with \\`let\\` and \\`const\\`.",
      "link": "#what-is-scope-in-javascript"
    },
    {
      "title": "What is a service worker",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7447871707219594529",
      "level": "advanced",
      "theme": "service worker, offline, caching",
      "text": "### What is a service worker?\n\nA service worker is a script that runs in the background, separate from the web page, enabling features like offline functionality, push notifications, and background sync. It acts as a proxy between the web app and the network.",
      "link": "#what-is-a-service-worker"
    },
    {
      "title": "How do you manipulate with DOM element",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7447865971974475041",
      "level": "basic",
      "theme": "DOM manipulation, JavaScript, elements",
      "text": "### How do you manipulate a DOM element?\n\nTo manipulate DOM elements, use methods like `document.getElementById`, `document.querySelector`, and properties like `.innerHTML`, `.style`, or methods like `appendChild` and `removeChild` to modify elements dynamically.",
      "link": "#how-do-you-manipulate-with-dom-element"
    },
    {
      "title": "How do you reuse information across service worker restarts",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7447841580880350497",
      "level": "advanced",
      "theme": "service worker, persistence, IndexedDB",
      "text": "### How do you reuse information across service worker restarts?\n\nTo reuse information across service worker restarts, store data in persistent storage mechanisms like IndexedDB or localStorage. This ensures data remains accessible even when the service worker restarts.",
      "link": "#how-do-you-reuse-information-across-service-worker-restarts"
    },
    {
      "title": "What is IndexedDB",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7447814335323278624",
      "level": "advanced",
      "theme": "IndexedDB, database, storage",
      "text": "### What is IndexedDB?\n\nIndexedDB is a low-level API for storing large amounts of structured data, including files and blobs. It allows advanced querying and persistent storage, making it ideal for offline-capable applications.",
      "link": "#what-is-indexeddb"
    },
    {
      "title": "What is memoization",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7447658154155871520",
      "level": "intermediate",
      "theme": "memoization, caching, performance",
      "text": "### What is memoization?\n\nMemoization is an optimization technique where function results are cached based on input arguments, avoiding redundant computations and improving performance.",
      "link": "#what-is-memoization"
    },
    {
      "title": "What is memoization",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7447658154155871520",
      "level": "intermediate",
      "theme": "memoization, caching, performance",
      "text": "### What is memoization?\n\nMemoization is an optimization technique where function results are cached based on input arguments, avoiding redundant computations and improving performance.",
      "link": "#what-is-memoization"
    },
    {
      "title": "What is a Prototype Chain in JavaScript?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7447534074211601697",
      "level": "basic",
      "theme": "prototype, inheritance, JavaScript",
      "text": "### What is a Prototype Chain in JavaScript?\n\nThe prototype chain is a fundamental concept in JavaScript's inheritance model. Every object in JavaScript has a prototype, which is another object. When you access a property of an object, JavaScript will first look for it in the object itself. If not found, it will look in the object's prototype, and then the prototype's prototype, and so on, until it reaches `null`.",
      "link": "#what-is-a-prototype-chain-in-javascript"
    },
    {
      "title": "What is a higher order function",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7447469800642727200",
      "level": "intermediate",
      "theme": "higher order functions, JavaScript",
      "text": "### What is a higher order function?\n\nA higher order function is a function that either takes one or more functions as arguments, returns a function, or both. This allows for more abstract and reusable code. Examples of higher order functions include `map()`, `filter()`, and `reduce()` in JavaScript.",
      "link": "#what-is-a-higher-order-function"
    },
    {
      "title": "What is the currying function",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7447172210076208417",
      "level": "advanced",
      "theme": "currying, functions, JavaScript",
      "text": "### What is the currying function?\n\nCurrying is a technique in functional programming where a function that takes multiple arguments is transformed into a sequence of functions, each taking a single argument. This can make the code more modular and reusable. For example, `function add(a) { return function(b) { return a + b; } }`.",
      "link": "#what-is-the-currying-function"
    },
    {
      "title": "How do you compare Object and Map",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7447122335863147808",
      "level": "advanced",
      "theme": "Object, Map, JavaScript",
      "text": "### How do you compare Object and Map?\n\nBoth `Object` and `Map` are key-value stores in JavaScript, but they have differences:\n\n1. **Key Types**: `Map` can use any data type as a key, while `Object` keys are always converted to strings.\n2. **Iteration**: `Map` preserves the order of insertion, while `Object` does not guarantee order.\n3. **Performance**: `Map` is generally more efficient for frequent additions and removals of key-value pairs.",
      "link": "#how-do-you-compare-object-and-map"
    },
    {
      "title": "What is a pure function",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7447104096424725792",
      "level": "advanced",
      "theme": "pure function, functional programming",
      "text": "### What is a pure function?\n\nA pure function is a function that, given the same input, will always return the same output and does not have any side effects. It does not modify any external state or depend on external variables. This makes pure functions predictable and easier to test, as well as a key concept in functional programming.",
      "link": "#what-is-a-pure-function"
    },
    {
      "title": "What is a Prototype Chain in JavaScript?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7446735468848270625",
      "level": "basic",
      "theme": "prototype, inheritance, JavaScript",
      "text": "### What is a Prototype Chain in JavaScript?\n\nThe prototype chain is a fundamental concept in JavaScript's inheritance model. Every object in JavaScript has a prototype, which is another object. When you access a property of an object, JavaScript will first look for it in the object itself. If not found, it will look in the object's prototype, and then the prototype's prototype, and so on, until it reaches `null`.",
      "link": "#what-is-a-prototype-chain-in-javascript"
    },
    {
      "title": "What is the purpose of the let keyword",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7446499450626772256",
      "level": "basic",
      "theme": "let keyword, JavaScript",
      "text": "### What is the purpose of the let keyword?\n\nThe `let` keyword in JavaScript is used to declare block-scoped variables. Unlike `var`, which declares variables globally or within a function scope, `let` restricts the variable's scope to the block, statement, or expression in which it is used. This makes `let` more predictable and avoids issues with variable hoisting.",
      "link": "#what-is-the-purpose-of-the-let-keyword"
    },
    {
      "title": "Arrow func?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7446420047448247585",
      "level": "basic",
      "theme": "arrow functions, JavaScript",
      "text": "### Arrow func?\n\nArrow functions in JavaScript are a shorter syntax for writing functions. They are defined using `=>` and do not have their own `this` value, which means they inherit `this` from the surrounding context. This makes them useful in situations like event handling and callbacks where `this` behavior can be tricky.",
      "link": "#arrow-func"
    },
    {
      "title": "What is the difference between let and var",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7446417854699687200",
      "level": "basic",
      "theme": "let, var, JavaScript",
      "text": "### What is the difference between let and var?\n\nThe primary differences between `let` and `var` are their scoping rules and hoisting behavior:\n\n1. **Scope**: `let` is block-scoped, while `var` is function-scoped.\n2. **Hoisting**: Both `let` and `var` are hoisted to the top of their scope, but `let` is not initialized until the code execution reaches it, leading to a Temporal Dead Zone (TDZ).",
      "link": "#what-is-the-difference-between-let-and-var"
    },
    {
      "title": "What is git bisect command?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7446337497484791073",
      "level": "advanced",
      "theme": "git, bisect, debugging",
      "text": "### What is git bisect command?\n\nThe `git bisect` command is used to find the commit that introduced a bug by performing a binary search. You start by marking a known good commit and a known bad commit. Git then checks out the midpoint commit, and you test it. Based on the result, Git narrows down the range of commits until the problematic one is found.",
      "link": "#what-is-git-bisect-command"
    },
    {
      "title": "What are lambda expressions or arrow functions?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7446080608989678880",
      "level": "basic",
      "theme": "lambda expressions, arrow functions, JavaScript",
      "text": "### What are lambda expressions or arrow functions?\n\nLambda expressions, also known as arrow functions, are a concise way to write functions in JavaScript. They use the `=>` syntax and do not have their own `this` value, meaning they inherit `this` from the surrounding context. They are often used for short, anonymous functions in callbacks or array methods.",
      "link": "#what-are-lambda-expressions-or-arrow-functions"
    },
    {
      "title": "What is the difference between == and === operators?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7446055928723508512",
      "level": "basic",
      "theme": "JavaScript",
      "text": "### What is the difference between == and === operators?\n\nIn JavaScript, `==` is the equality operator that compares values after performing type coercion, meaning it converts the values to a common type before comparing them. On the other hand, `===` is the strict equality operator, which compares both the value and the type without any type conversion.",
      "link": "#what-is-the-difference-between-and-operators"
    },
    {
      "title": "What is the purpose of the array splice method?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7446035575565520160",
      "level": "basic",
      "theme": "splice, array, JavaScript",
      "text": "### What is the purpose of the array splice method?\n\nThe `splice()` method in JavaScript is used to modify an array by adding, removing, or replacing elements. It takes at least two arguments: the index at which to start changing the array, and the number of elements to remove. Additional arguments can be provided to add new elements.",
      "link": "#what-is-the-purpose-of-the-array-splice-method"
    },
    {
      "title": "What is the difference between slice and splice?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7446029933446565152",
      "level": "basic",
      "theme": "slice, splice, JavaScript",
      "text": "### What is the difference between slice and splice?\n\n`slice()` is used to extract a shallow copy of a portion of an array without modifying the original array, while `splice()` is used to change the contents of an array by removing or replacing elements. The key difference is that `slice()` does not alter the array, while `splice()` does.",
      "link": "#what-is-the-difference-between-slice-and-splice"
    },
    {
      "title": "5 Ways to Create Objects in JavaScript?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7445448146685136161",
      "level": "basic",
      "theme": "objects, creation, JavaScript",
      "text": "### 5 Ways to Create Objects in JavaScript\n\nIn JavaScript, objects can be created in various ways. The five most common methods are:\n\n1. **Object Literal**: `const obj = {}`\n2. **Object Constructor**: `const obj = new Object()`\n3. **Object.create()**: `const obj = Object.create(null)`\n4. **Class Syntax**: `class MyClass { constructor() {} }`\n5. **Factory Functions**: `function createObject() { return {}}`",
      "link": "#5-ways-to-create-objects-in-javascript"
    },
    {
      "title": "What is git rebase command?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7444874869394771232",
      "level": "basic",
      "theme": "git, rebase, version control",
      "text": "### What is git rebase command?\n\nThe `git rebase` command is used to integrate changes from one branch into another. It works by moving or 'replaying' commits from one branch onto another, creating a linear history. This is different from `git merge`, which creates a merge commit. `git rebase` can be used to keep a cleaner, more linear commit history.",
      "link": "#what-is-git-rebase-command"
    },
    {
      "title": "What is git reflog command?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7444873101717884192",
      "level": "basic",
      "theme": "git, reflog, version control",
      "text": "### What is git reflog command?\n\nThe `git reflog` command is used to show the history of changes to the reference logs, which track updates to the branches in a repository. This can be useful for recovering lost commits or understanding the changes made to a branch, especially after actions like rebasing or resetting.",
      "link": "#what-is-git-reflog-command"
    },
    {
      "title": "What is git revert command?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7444867368431439136",
      "level": "basic",
      "theme": "git, revert, version control",
      "text": "### What is git revert command?\n\nThe `git revert` command is used to create a new commit that undoes the changes made by a previous commit. Unlike `git reset`, which alters the commit history, `git revert` preserves the commit history and is often used in shared repositories to undo changes safely.",
      "link": "#what-is-git-revert-command"
    },
    {
      "title": "What is a storage event and its event handler?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7448353911720742177",
      "level": "intermediate",
      "theme": "storage event, event handler, web storage",
      "text": "### What is a storage event and its event handler?\n\nA storage event is triggered when a change is made to the `localStorage` or `sessionStorage` in the browser, such as adding, removing, or modifying a key-value pair. The event handler for this event allows you to respond to these changes, providing a way to synchronize or react to storage updates across different windows or tabs.",
      "link": "#what-is-a-storage-event-and-its-event-handler"
    },
    {
      "title": "What are the methods available on session storage?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7448368128825888032",
      "level": "basic",
      "theme": "sessionStorage, web storage",
      "text": "### What are the methods available on session storage?\n\n`sessionStorage` provides methods to interact with the browser's session storage. Key methods include:\n\n- `setItem(key, value)`: Adds a key-value pair.\n- `getItem(key)`: Retrieves the value for a given key.\n- `removeItem(key)`: Removes the key-value pair.\n- `clear()`: Clears all data stored in sessionStorage.",
      "link": "#what-are-the-methods-available-on-session-storage"
    },
    {
      "title": "How do you access web storage?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7448375078183587105",
      "level": "basic",
      "theme": "web storage, sessionStorage, localStorage",
      "text": "### How do you access web storage?\n\nWeb storage is accessed using the `localStorage` or `sessionStorage` objects in JavaScript. For example, you can use `localStorage.setItem('key', 'value')` to store data, and `localStorage.getItem('key')` to retrieve it. Both `localStorage` and `sessionStorage` are part of the Window interface and provide a simple API for storing key-value pairs.",
      "link": "#how-do-you-access-web-storage"
    },
    {
      "title": "What is the main difference between localStorage and sessionStorage?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7448379916778851617",
      "level": "basic",
      "theme": "localStorage, sessionStorage, web storage",
      "text": "### What is the main difference between localStorage and sessionStorage?\n\nThe main difference is the lifespan of the stored data:\n- **`localStorage`** persists data even after the browser is closed, and the data remains available until explicitly removed.\n- **`sessionStorage`** only stores data for the duration of the page session. Once the tab or window is closed, the data is cleared.",
      "link": "#what-is-the-main-difference-between-localstorage-and-sessionstorage"
    },
    {
      "title": "Why do you need a Cookie?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7448385477113171233",
      "level": "intermediate",
      "theme": "cookies, web storage, HTTP",
      "text": "### Why do you need a Cookie?\n\nCookies are used to store data on the client-side, typically for purposes like tracking user sessions, saving preferences, or authenticating users. They are sent to the server with every HTTP request, allowing the server to remember information about the client across requests and sessions.",
      "link": "#why-do-you-need-a-cookie"
    },
    {
      "title": "What is a Cookie?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7448395347279236384",
      "level": "basic",
      "theme": "cookies, web storage, HTTP",
      "text": "### What is a Cookie?\n\nA cookie is a small piece of data stored by the browser on the client-side. It is sent to the server with every HTTP request and is used for various purposes such as maintaining user sessions, tracking user activity, and storing preferences.",
      "link": "#what-is-a-cookie"
    },
    {
      "title": "What is web storage?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7448401312728878368",
      "level": "basic",
      "theme": "web storage, localStorage, sessionStorage",
      "text": "### What is web storage?\n\nWeb storage provides a way to store data in the browser. It includes two types: `localStorage` and `sessionStorage`. `localStorage` stores data persistently, while `sessionStorage` stores data for the duration of a session, which is cleared when the browser or tab is closed.",
      "link": "#what-is-web-storage"
    },
    {
      "title": "What Are Server-Sent Events (SSE)?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7448434434774142240",
      "level": "intermediate",
      "theme": "SSE, real-time communication, web technologies",
      "text": "### What Are Server-Sent Events (SSE)?\n\nServer-Sent Events (SSE) is a technology that allows a server to push updates to the client over a single HTTP connection. This is typically used for real-time applications such as notifications, live scores, or chat apps, where the server sends updates to the client automatically.",
      "link": "#what-are-server-sent-events-sse"
    },
    {
      "title": "What Is a Callback Hell?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7448549870673169696",
      "level": "intermediate",
      "theme": "callback hell, asynchronous, JavaScript",
      "text": "### What Is a Callback Hell?\n\nCallback hell, also known as 'Pyramid of Doom,' refers to a situation where multiple nested callback functions in JavaScript make the code hard to read and maintain. It usually occurs in asynchronous code and can be mitigated by using Promises or async/await.",
      "link": "#what-is-a-callback-hell"
    },
    {
      "title": "Importance of Callbacks in Javascript?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7448582345390591265",
      "level": "basic",
      "theme": "callbacks, JavaScript, asynchronous programming",
      "text": "### Importance of Callbacks in Javascript?\n\nCallbacks in JavaScript are functions passed as arguments to other functions, enabling asynchronous programming. They allow for non-blocking code execution, making it possible to handle events like user input or network requests without freezing the application.",
      "link": "#importance-of-callbacks-in-javascript"
    },
    {
      "title": "What is a callback function in javascript?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7448614606278282529",
      "level": "basic",
      "theme": "callback function, JavaScript, asynchronous programming",
      "text": "### What is a callback function in javascript?\n\nA callback function is a function passed into another function as an argument and executed after the completion of a task. Callbacks are commonly used in asynchronous programming, such as handling events or making HTTP requests.",
      "link": "#what-is-a-callback-function-in-javascript"
    },
    {
      "title": "What Are the Three States of a Promise?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7448655823150058785",
      "level": "intermediate",
      "theme": "Promise, JavaScript, asynchronous programming",
      "text": "### What Are the Three States of a Promise?\n\nA Promise in JavaScript can be in one of three states:\n- **Pending**: The initial state, neither fulfilled nor rejected.\n- **Fulfilled**: The operation completed successfully.\n- **Rejected**: The operation failed.",
      "link": "#what-are-the-three-states-of-a-promise"
    },
    {
      "title": "Why do you need a promise?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7448671709634235681",
      "level": "intermediate",
      "theme": "Promise, asynchronous programming",
      "text": "### Why do you need a promise?\n\nPromises are used to handle asynchronous operations in JavaScript. They provide a cleaner way to handle asynchronous code, avoiding callback hell by chaining `.then()` and `.catch()` methods to handle success and failure, respectively.",
      "link": "#why-do-you-need-a-promise"
    },
    {
      "title": "What is a promise?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7448715825642540320",
      "level": "intermediate",
      "theme": "Promise, JavaScript, asynchronous programming",
      "text": "### What is a promise?\n\nA promise is an object in JavaScript that represents the eventual completion (or failure) of an asynchronous operation and its resulting value. It allows you to attach `.then()` and `.catch()` methods to handle the results or errors of the asynchronous task.",
      "link": "#what-is-a-promise"
    },
    {
      "title": "What are the restrictions of web workers on DOM?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7448725365574372641",
      "level": "advanced",
      "theme": "web workers, DOM, JavaScript",
      "text": "### What are the restrictions of web workers on DOM?\n\nWeb workers run in a separate thread and cannot directly access or modify the DOM. They are designed for heavy computations and background tasks. To interact with the DOM, workers communicate with the main thread using message passing via `postMessage()`.",
      "link": "#what-are-the-restrictions-of-web-workers-on-dom"
    },
    {
      "title": "Give an example of a web worker?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7448739040213437729",
      "level": "intermediate",
      "theme": "web workers, JavaScript",
      "text": "### Give an example of a web worker?\n\nA simple web worker example:\n\n```javascript\nconst worker = new Worker('worker.js');\nworker.postMessage('Hello');\nworker.onmessage = function(event) {\n  console.log('Received from worker:', event.data);\n};\n```\nIn the `worker.js` file, you would handle the message with `onmessage` and use `postMessage` to send a response back.",
      "link": "#give-an-example-of-a-web-worker"
    },
    {
      "title": "How do you check web storage browser support?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7448750198848769313",
      "level": "basic",
      "theme": "web storage, browser support, JavaScript",
      "text": "### How do you check web storage browser support?\n\nTo check if a browser supports web storage, you can check if `localStorage` or `sessionStorage` is available:\n\n```javascript\nif (typeof(Storage) !== 'undefined') {\n  // Web storage is supported\n} else {\n  // Web storage is not supported\n}\n```",
      "link": "#how-do-you-check-web-storage-browser-support"
    },
    {
      "title": "Why do you need web storage?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7448934582965046561",
      "level": "basic",
      "theme": "web storage, JavaScript",
      "text": "### Why do you need web storage?\n\nWeb storage allows you to store data on the client side, providing faster access to information without requiring a round-trip to the server. It helps with tasks like saving user preferences, session information, and caching data for offline use.",
      "link": "#why-do-you-need-web-storage"
    },
    {
      "title": "How Do You Receive Server-Sent Event Notifications?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7448989685881376033",
      "level": "intermediate",
      "theme": "Server-Sent Events, notifications, web technologies",
      "text": "### How Do You Receive Server-Sent Event Notifications?\n\nTo receive Server-Sent Event (SSE) notifications, you need to create an `EventSource` object in JavaScript, which listens for events sent by the server. For example:\n\n```javascript\nconst eventSource = new EventSource('https://example.com/sse');\neventSource.onmessage = function(event) {\n  console.log('New message:', event.data);\n};\n```",
      "link": "#how-do-you-receive-server-sent-event-notifications"
    },
    {
      "title": "What Is a Callback in Callback?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7449011382449720608",
      "level": "intermediate",
      "theme": "callbacks, asynchronous programming, JavaScript",
      "text": "### What Is a Callback in Callback?\n\nA 'callback in callback' refers to a situation where a function is passed as a parameter to another function, and that function in turn calls another function (callback) within it. This can lead to nested callbacks, which may result in 'callback hell' if not managed properly.",
      "link": "#what-is-a-callback-in-callback"
    },
    {
      "title": "What Is Promise Chaining in JavaScript?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7449040289345457441",
      "level": "intermediate",
      "theme": "Promises, JavaScript, asynchronous programming",
      "text": "### What Is Promise Chaining in JavaScript?\n\nPromise chaining allows you to chain multiple `.then()` calls to handle sequential asynchronous operations. Each `.then()` returns a new promise, enabling the next step in the chain to execute after the previous one is fulfilled.\n\n```javascript\nfetchData()\n  .then(result => processData(result))\n  .then(processedData => displayData(processedData))\n  .catch(error => console.error(error));\n```",
      "link": "#what-is-promise-chaining-in-javascript"
    },
    {
      "title": "What Are the Main Rules of Promise in JavaScript?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7449057432086580513",
      "level": "intermediate",
      "theme": "Promises, JavaScript",
      "text": "### What Are the Main Rules of Promise in JavaScript?\n\nThe main rules of Promises in JavaScript are:\n1. A promise can be in one of three states: pending, fulfilled, or rejected.\n2. A promise can only transition from pending to fulfilled or rejected, and cannot change back.\n3. You can attach `.then()` to handle success and `.catch()` for errors.",
      "link": "#what-are-the-main-rules-of-promise-in-javascript"
    },
    {
      "title": "What Are the Events Available for Server-Sent Events?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7449065499603881248",
      "level": "intermediate",
      "theme": "Server-Sent Events, web technologies",
      "text": "### What Are the Events Available for Server-Sent Events?\n\nServer-Sent Events (SSE) support several event types, including:\n- `message`: The default event for incoming data.\n- `open`: Fired when the connection to the server is established.\n- `error`: Fired when there is an error with the connection.",
      "link": "#what-are-the-events-available-for-server-sent-events"
    },
    {
      "title": "How Do You Check Browser Support for Server-Sent Events?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7449149383142018336",
      "level": "basic",
      "theme": "Server-Sent Events, browser support",
      "text": "### How Do You Check Browser Support for Server-Sent Events?\n\nTo check if the browser supports Server-Sent Events, you can check for the `EventSource` object:\n\n```javascript\nif (typeof(EventSource) !== 'undefined') {\n  // SSE is supported\n} else {\n  // SSE is not supported\n}\n```",
      "link": "#how-do-you-check-browser-support-for-server-sent-events"
    },
    {
      "title": "What Is `Promise.all` in JavaScript?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7449321820743847200",
      "level": "intermediate",
      "theme": "Promises, JavaScript, asynchronous programming",
      "text": "### What Is `Promise.all` in JavaScript?\n\n`Promise.all` is a method that accepts an array of promises and returns a single promise that resolves when all the promises in the array are resolved. If any of the promises reject, the returned promise will reject immediately.\n\n```javascript\nPromise.all([promise1, promise2, promise3])\n  .then(results => console.log(results))\n  .catch(error => console.error(error));\n```",
      "link": "#what-is-promise-all-in-javascript"
    },
    {
      "title": "What Is the Purpose of the `race` Method in Promises?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7449363438461144353",
      "level": "intermediate",
      "theme": "Promises, JavaScript, asynchronous programming",
      "text": "### What Is the Purpose of the `race` Method in Promises?\n\nThe `Promise.race()` method returns a promise that resolves or rejects as soon as one of the promises in the iterable resolves or rejects. It is useful when you need to wait for the first promise to settle.\n\n```javascript\nPromise.race([promise1, promise2, promise3])\n  .then(result => console.log(result))\n  .catch(error => console.error(error));\n```",
      "link": "#what-is-the-purpose-of-the-race-method-in-promises"
    },
    {
      "title": "What Is Strict Mode in JavaScript?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7449392707455175968",
      "level": "intermediate",
      "theme": "JavaScript, strict mode",
      "text": "### What Is Strict Mode in JavaScript?\n\nStrict mode is a way to opt in to a restricted version of JavaScript. It helps catch common coding mistakes and prevents the use of certain features that can lead to bugs, such as using undeclared variables.\n\n```javascript\n'use strict';\nvar x = 3.14; // Error in strict mode: assignment to undeclared variable\n```",
      "link": "#what-is-strict-mode-in-javascript"
    },
    {
      "title": "What Is the Purpose of Double Exclamation in JavaScript?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7449429710985022753",
      "level": "basic",
      "theme": "JavaScript, type coercion",
      "text": "### What Is the Purpose of Double Exclamation in JavaScript?\n\nDouble exclamation (`!!`) is used to convert a value into a boolean. The first exclamation negates the value, and the second negates it again, resulting in a boolean representation of the value.\n\n```javascript\nconsole.log(!!'string'); // true\nconsole.log(!!0); // false\n```",
      "link": "#what-is-the-purpose-of-double-exclamation-in-javascript"
    },
    {
      "title": "How Do You Declare Strict Mode in JavaScript?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7449490448533507361",
      "level": "basic",
      "theme": "JavaScript, strict mode",
      "text": "### How Do You Declare Strict Mode in JavaScript?\n\nTo declare strict mode in JavaScript, simply add `'use strict';` at the beginning of a script or a function.\n\n```javascript\n'use strict';\n// Code here will be executed in strict mode\n```",
      "link": "#how-do-you-declare-strict-mode-in-javascript"
    },
    {
      "title": "How Do You Detect Caps Lock Key Turned On or Not?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7449671849920761120",
      "level": "intermediate",
      "theme": "JavaScript, event handling, keyboard events",
      "text": "### How Do You Detect Caps Lock Key Turned On or Not?\n\nTo detect whether Caps Lock is on, you can use the `keydown` or `keypress` event and check the `event.getModifierState('CapsLock')` property.\n\n```javascript\ndocument.addEventListener('keydown', function(event) {\n  if (event.getModifierState('CapsLock')) {\n    console.log('Caps Lock is on');\n  }\n});\n```",
      "link": "#how-do-you-detect-caps-lock-key-turned-on-or-not"
    },
    {
      "title": "How Do You Access History in JavaScript?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7449732288268487969",
      "level": "basic",
      "theme": "JavaScript, history API",
      "text": "### How Do You Access History in JavaScript?\n\nYou can access the browser history using the `window.history` object. This allows you to manipulate the session history (navigate, go back, forward, etc.).\n\n```javascript\nwindow.history.back(); // Go back to the previous page\nwindow.history.forward(); // Go forward in history\n```",
      "link": "#how-do-you-access-history-in-javascript"
    },
    {
      "title": "What Is the Difference Between `window` and `document` in JavaScript?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7449755076182215968",
      "level": "basic",
      "theme": "JavaScript, DOM",
      "text": "### What Is the Difference Between `window` and `document` in JavaScript?\n\n`window` represents the browser window and is the global object in the browser's JavaScript environment. `document`, on the other hand, represents the HTML document loaded in the browser, allowing interaction with the DOM.\n\n```javascript\nconsole.log(window); // Browser window\nconsole.log(document); // HTML document\n```",
      "link": "#what-is-the-difference-between-window-and-document-in-javascript"
    },
    {
      "title": "What Is the Purpose of Double Exclamation in JavaScript?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7449813378895203617",
      "level": "basic",
      "theme": "JavaScript, type coercion",
      "text": "### What Is the Purpose of Double Exclamation in JavaScript?\n\nDouble exclamation (`!!`) is used to convert a value to a boolean. The first negation converts it to a boolean, and the second negation reverts it to the correct boolean value.\n\n```javascript\nconsole.log(!!'text'); // true\nconsole.log(!!null); // false\n```",
      "link": "#what-is-the-purpose-of-double-exclamation-in-javascript"
    },
    {
      "title": "What Is `eval` in JavaScript?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7449833381975559446",
      "level": "intermediate",
      "theme": "JavaScript, security",
      "text": "### What Is `eval` in JavaScript?\n\n`eval()` is a JavaScript function that evaluates a string of JavaScript code. It is generally discouraged due to security risks such as code injection vulnerabilities.\n\n```javascript\neval('console.log(\"Hello, World!\")'); // Logs 'Hello, World!'\n```",
      "link": "#what-is-eval-in-javascript"
    },
    {
      "title": "What Is the `null` Value in JavaScript?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7449876086793489696",
      "level": "basic",
      "theme": "JavaScript, data types",
      "text": "### What Is the `null` Value in JavaScript?\n\n`null` is a primitive value that represents the intentional absence of any object value. It is used to indicate that a variable is empty or uninitialized.\n\n```javascript\nlet x = null;\nconsole.log(x); // null\n```",
      "link": "#what-is-the-null-value-in-javascript"
    },
    {
      "title": "What Is the `undefined` Property in JavaScript?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7450179747931278624",
      "level": "basic",
      "theme": "JavaScript, data types",
      "text": "### What Is the `undefined` Property in JavaScript?\n\n`undefined` is a primitive value that is automatically assigned to variables that are declared but not initialized. It represents the absence of a defined value.\n\n```javascript\nlet x;\nconsole.log(x); // undefined\n```",
      "link": "#what-is-the-undefined-property-in-javascript"
    },
    {
      "title": "What Is the Purpose of the `delete` Operator in JavaScript?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7450258222222560544",
      "level": "intermediate",
      "theme": "JavaScript, operators",
      "text": "### What Is the Purpose of the `delete` Operator in JavaScript?\n\nThe `delete` operator is used to remove a property from an object or an element from an array.\n\n```javascript\nlet obj = { name: 'John', age: 30 };\ndelete obj.age;\nconsole.log(obj); // { name: 'John' }\n```",
      "link": "#what-is-the-purpose-of-the-delete-operator-in-javascript"
    },
    {
      "title": "What Is the `typeof` Operator in JavaScript?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7450568773712497953",
      "level": "basic",
      "theme": "JavaScript, operators",
      "text": "### What Is the `typeof` Operator in JavaScript?\n\nThe `typeof` operator returns a string indicating the type of the unevaluated operand. It is commonly used to check the type of variables or expressions.\n\n```javascript\nconsole.log(typeof 'Hello'); // string\nconsole.log(typeof 123); // number\n```",
      "link": "#what-is-the-typeof-operator-in-javascript"
    },
    {
      "title": "What Is `isNaN` in JavaScript?",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7450774214459673888",
      "level": "basic",
      "theme": "JavaScript, type checking",
      "text": "### What Is `isNaN` in JavaScript?\n\n`isNaN()` is a function that checks whether a value is NaN (Not-a-Number). It returns `true` if the value is NaN, and `false` otherwise.\n\n```javascript\nconsole.log(isNaN(123)); // false\nconsole.log(isNaN('Hello')); // true\n```",
      "link": "#what-is-isnan-in-javascript"
    },
    {
      "title": "What are the differences between undeclared and undefined variables",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7450925531370884385",
      "level": "basic",
      "theme": "JavaScript, variables",
      "text": "### What are the differences between undeclared and undefined variables?\n\nAn undeclared variable is one that has not been declared using `var`, `let`, or `const`. An undefined variable is one that has been declared but not assigned a value.",
      "link": "#what-are-the-differences-between-undeclared-and-undefined-variables"
    },
    {
      "title": "What are global variables",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7450838618257575201",
      "level": "basic",
      "theme": "JavaScript, variables",
      "text": "### What are global variables?\n\nGlobal variables are variables that are declared outside of any function and are accessible from any part of the code.",
      "link": "#what-are-global-variables"
    },
    {
      "title": "What are the problems with global variables",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7451163740982070561",
      "level": "intermediate",
      "theme": "JavaScript, best practices",
      "text": "### What are the problems with global variables?\n\nGlobal variables can cause issues like name collisions, difficulty in debugging, and unintended side effects. It's recommended to limit the use of global variables.",
      "link": "#what-are-the-problems-with-global-variables"
    },
    {
      "title": "What is NaN property",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7451255958266760480",
      "level": "basic",
      "theme": "JavaScript, type checking",
      "text": "### What is NaN property?\n\n`NaN` (Not-a-Number) is a special value in JavaScript that represents an invalid or undefined numerical result, such as the result of dividing 0 by 0.",
      "link": "#what-is-nan-property"
    },
    {
      "title": "What is the purpose of isFinite function",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, type checking",
      "text": "### What is the purpose of isFinite function?\n\n`isFinite()` is used to check if a value is a finite number. It returns `true` if the value is a finite number, and `false` otherwise.",
      "link": "#what-is-the-purpose-of-isfinite-function"
    },
    {
      "title": "What is an event flow",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7451321489682468128",
      "level": "intermediate",
      "theme": "JavaScript, events",
      "text": "### What is an event flow?\n\nEvent flow in JavaScript refers to the order in which events are propagated through the DOM. It consists of three phases: capturing phase, target phase, and bubbling phase.",
      "link": "#what-is-an-event-flow"
    },
    {
      "title": "What is event bubbling",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7451597511862603040",
      "level": "basic",
      "theme": "JavaScript, events",
      "text": "### What is event bubbling?\n\nEvent bubbling is the process where an event triggered on a child element is propagated up to its parent elements. It is the default behavior for most events in JavaScript.",
      "link": "#what-is-event-bubbling"
    },
    {
      "link": "#can-i-add-getters-and-setters-using-defineproperty-method",
      "title": "Can I add getters and setters using defineProperty method",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### Can I add getters and setters using defineProperty method?\n\nYes, you can add getters and setters using `Object.defineProperty()`. This allows you to define custom getter and setter methods for specific properties.\n\nExample:\n\n```javascript\nconst person = {};\nObject.defineProperty(person, 'name', {\n  get() { return this._name; },\n  set(value) { this._name = value.toUpperCase(); }\n});\nperson.name = 'John';\nconsole.log(person.name); // 'JOHN'\n```"
    },
    {
      "link": "#can-i-avoid-using-postmessages-completely",
      "title": "Can I avoid using postMessages completely",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Security",
      "text": "### Can I avoid using postMessages completely?\n\nWhile `postMessage` is a useful API for cross-origin communication, alternatives like `localStorage`, `cookies`, or server-side messaging (e.g., WebSockets) can be used depending on the use case. Avoiding `postMessage` may increase security in certain scenarios."
    },
    {
      "link": "#can-i-redeclare-let-and-const-variables",
      "title": "Can I redeclare let and const variables",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Variables",
      "text": "### Can I redeclare `let` and `const` variables?\n\nNo, you cannot redeclare `let` and `const` variables in the same scope. The `let` and `const` declarations are block-scoped, and attempting to redeclare them will result in a syntax error.\n\nExample:\n\n```javascript\nlet x = 10;\nlet x = 20;  // Error: Cannot redeclare block-scoped variable 'x'\n```"
    },
    {
      "link": "#can-i-use-reserved-words-as-identifiers",
      "title": "Can I use reserved words as identifiers",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7457212868161850657",
      "level": "basic",
      "theme": "JavaScript, syntax",
      "text": "### Can I use reserved words as identifiers?\n\nNo, you cannot use reserved words (such as `let`, `class`, `function`, etc.) as identifiers (variable names, function names, etc.) in JavaScript.\n\nExample:\n\n```javascript\nlet let = 5; // SyntaxError: Unexpected token 'let'\n```"
    },
    {
      "link": "#can-we-define-properties-for-functions",
      "title": "Can we define properties for functions",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456170349391023393",
      "level": "basic",
      "theme": "JavaScript, functions",
      "text": "### Can we define properties for functions?\n\nYes, functions in JavaScript are objects, so you can define properties for them.\n\n```javascript\nfunction myFunc() {}\nmyFunc.property = 'value';\nconsole.log(myFunc.property); // 'value'\n```"
    },
    {
      "link": "#can-you-apply-chaining-on-conditional-operator",
      "title": "Can you apply chaining on conditional operator",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7458016862446570785",
      "level": "basic",
      "theme": "JavaScript, operators",
      "text": "### Can you apply chaining on conditional operator?\n\nYes, you can chain multiple conditional operators together to evaluate multiple conditions in a single expression.\n\nExample:\n\n```javascript\nconst result = (age >= 18) ? 'Adult' : (age >= 13) ? 'Teen' : 'Child';\n```"
    },
    {
      "link": "#can-you-give-an-example-of-when-you-really-need-a-semicolon",
      "title": "Can you give an example of when you really need a semicolon",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7457679188732939553",
      "level": "basic",
      "theme": "JavaScript, syntax",
      "text": "### Can you give an example of when you really need a semicolon?\n\nSemicolons are generally optional in JavaScript, but there are situations where they are required. For example, when returning an object from a function on the same line.\n\nExample:\n\n```javascript\nreturn { key: 'value' }; // Requires semicolon\n```"
    },
    {
      "link": "#can-you-write-a-random-integers-function-to-print-integers-within-a-range",
      "title": "Can you write a random integers function to print integers within a range",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456920292397518112",
      "level": "basic",
      "theme": "JavaScript, math",
      "text": "### Can you write a random integers function to print integers within a range?\n\nYou can create a function that generates random integers within a specified range.\n\nExample:\n\n```javascript\nfunction getRandomInt(min, max) {\n  return Math.floor(Math.random() * (max - min + 1)) + min;\n}\nconsole.log(getRandomInt(1, 100)); // Generates a random integer between 1 and 100\n```"
    },
    {
      "link": "#check-for-anagrams",
      "title": "Check for Anagrams",
      "url": "https://www.tiktok.com/@jsmentoring/video/7458386392272473377",
      "level": "intermediate",
      "theme": "JavaScript, Strings, Algorithm",
      "text": "### Check for Anagrams\n\nAn anagram is a word or phrase formed by rearranging the letters of another, using all the original letters exactly once.\n\n#### Algorithm:\n1. Remove any non-alphanumeric characters and convert both strings to lowercase.\n2. Check if the lengths of the two strings are the same. If not, they cannot be anagrams.\n3. Count the frequency of each character in the first string.\n4. Compare the character counts with the second string by decrementing the counts. If any count becomes negative or mismatches, the strings are not anagrams.\n\n#### Example:\n```javascript\nfunction areAnagrams(str1, str2) {\n    // Normalize the strings: remove non-alphanumeric characters and convert to lowercase\n    const normalize = str => str.replace(/[^a-zA-Z0-9]/g, '').toLowerCase();\n    const s1 = normalize(str1);\n    const s2 = normalize(str2);\n\n    if (s1.length !== s2.length) {\n        return false; // Different lengths mean they can't be anagrams\n    }\n\n    const charCount = {};\n\n    // Count characters in the first string\n    for (const char of s1) {\n        charCount[char] = (charCount[char] || 0) + 1;\n    }\n\n    // Compare characters with the second string\n    for (const char of s2) {\n        if (!charCount[char]) {\n            return false; // Character mismatch\n        }\n        charCount[char]--;\n    }\n\n    return true; // Strings are anagrams\n}\n\n// Example usage\nconsole.log(areAnagrams(\"listen\", \"silent\")); // Output: true\nconsole.log(areAnagrams(\"hello\", \"world\")); // Output: false\n```\n\nThis method has a time complexity of O(n), where n is the length of the strings."
    },
    {
      "link": "#check-if-a-number-is-perfect",
      "title": "Check if a Number is Perfect",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Math, Algorithm",
      "text": "### Check if a Number is Perfect\n\nA perfect number is a positive integer that is equal to the sum of its proper divisors (excluding the number itself).\n\n#### Algorithm:\n1. Initialize a variable to store the sum of divisors.\n2. Iterate from 1 to half of the number.\n3. For each divisor, add it to the sum.\n4. If the sum equals the original number, return `true`, otherwise return `false`.\n\n#### Example:\n```javascript\nfunction isPerfectNumber(num) {\n    let sum = 0;\n    for (let i = 1; i <= num / 2; i++) {\n        if (num % i === 0) sum += i;\n    }\n    return sum === num;\n}\n\n// Example usage\nconsole.log(isPerfectNumber(28)); // Output: true\nconsole.log(isPerfectNumber(6));  // Output: true\nconsole.log(isPerfectNumber(10)); // Output: false\n```\n\nThis method has a time complexity of O(n), where n is the number being checked."
    },
    {
      "link": "#check-if-a-number-is-prime",
      "title": "Check if a Number is Prime",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Numbers, Algorithm",
      "text": "### Check if a Number is Prime\n\nTo check if a number is prime, verify that it is greater than 1 and divisible only by 1 and itself.\n\n#### Algorithm:\n1. Check if the number is less than or equal to 1; if so, return false.\n2. Iterate through numbers from 2 to the square root of the number.\n3. If the number is divisible by any of these, return false.\n4. If no divisors are found, return true.\n\n#### Example:\n```javascript\nfunction isPrime(num) {\n    if (num <= 1) {\n        return false;\n    }\n\n    for (let i = 2; i <= Math.sqrt(num); i++) {\n        if (num % i === 0) {\n            return false;\n        }\n    }\n\n    return true;\n}\n\n// Example usage\nconsole.log(isPrime(7)); // Output: true\nconsole.log(isPrime(10)); // Output: false\n```\n\nThis method has a time complexity of O(sqrt(n)), where n is the number being checked."
    },
    {
      "link": "#check-if-a-string-is-a-palindrome",
      "title": "Check if a String is a Palindrome",
      "url": "https://www.tiktok.com/@jsmentoring/video/7458413373315681569",
      "level": "basic",
      "theme": "JavaScript, Strings, Algorithm",
      "text": "### Check if a String is a Palindrome\n\nA palindrome is a word, phrase, or sequence that reads the same backward as forward.\n\n#### Algorithm:\n1. Remove all non-alphanumeric characters and convert the string to lowercase to handle case sensitivity.\n2. Use two pointers: one starting at the beginning and the other at the end of the string.\n3. Compare characters at the two pointers. If they differ, the string is not a palindrome.\n4. Move the pointers closer to the center and repeat the comparison.\n5. If all characters match, the string is a palindrome.\n\n#### Example:\n```javascript\nfunction isPalindrome(str) {\n    // Normalize the string: remove non-alphanumeric characters and convert to lowercase\n    const cleanStr = str.replace(/[^a-zA-Z0-9]/g, '').toLowerCase();\n\n    let left = 0;\n    let right = cleanStr.length - 1;\n\n    while (left < right) {\n        if (cleanStr[left] !== cleanStr[right]) {\n            return false; // Not a palindrome\n        }\n        left++;\n        right--;\n    }\n\n    return true; // It's a palindrome\n}\n\n// Example usage\nconsole.log(isPalindrome(\"A man, a plan, a canal, Panama\")); // Output: true\nconsole.log(isPalindrome(\"hello\")); // Output: false\n```\n\nThis method has a time complexity of O(n), where n is the length of the string."
    },
    {
      "link": "#check-if-a-string-is-palindromic-permutation",
      "title": "Check if a String is a Palindromic Permutation",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Strings, Algorithm",
      "text": "### Check if a String is a Palindromic Permutation\n\nTo check if a string is a permutation of a palindrome, the string's characters must appear in pairs (except possibly one character for odd-length strings).\n\n#### Algorithm:\n1. Count the frequency of each character in the string.\n2. Check how many characters have an odd frequency.\n3. If more than one character has an odd frequency, return false; otherwise, return true.\n\n#### Example:\n```javascript\nfunction isPalindromicPermutation(str) {\n    const freqMap = {};\n\n    for (const char of str) {\n        freqMap[char] = (freqMap[char] || 0) + 1;\n    }\n\n    let oddCount = 0;\n    for (const count of Object.values(freqMap)) {\n        if (count % 2 !== 0) {\n            oddCount += 1;\n        }\n    }\n\n    return oddCount <= 1;\n}\n\n// Example usage\nconsole.log(isPalindromicPermutation(\"civic\")); // Output: true\nconsole.log(isPalindromicPermutation(\"ivicc\")); // Output: true\nconsole.log(isPalindromicPermutation(\"hello\")); // Output: false\n```\n\nThis method has a time complexity of O(n), where n is the length of the string."
    },
    {
      "link": "#check-if-a-string-is-rotated",
      "title": "Check if a String is Rotated",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Strings, Algorithm",
      "text": "### Check if a String is Rotated\n\nTo check if one string is a rotation of another, concatenate the first string with itself and check if the second string is a substring of the result.\n\n#### Algorithm:\n1. Concatenate the first string with itself.\n2. Check if the second string is a substring of the concatenated string.\n3. If it is, return `true`; otherwise, return `false`.\n\n#### Example:\n```javascript\nfunction isRotated(str1, str2) {\n    if (str1.length !== str2.length) return false;\n    return (str1 + str1).includes(str2);\n}\n\n// Example usage\nconsole.log(isRotated('abcde', 'cdeab')); // Output: true\nconsole.log(isRotated('abcde', 'abced')); // Output: false\n```\n\nThis method has a time complexity of O(n), where n is the length of the strings."
    },
    {
      "link": "#check-if-an-array-is-sorted",
      "title": "Check if an Array is Sorted",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Check if an Array is Sorted\n\nTo check if an array is sorted, compare each element with the next one to ensure it is in the correct order.\n\n#### Algorithm:\n1. Iterate through the array and compare each element with the next.\n2. If any element is greater than the next one, the array is not sorted.\n3. If no such element is found, return true; otherwise, return false.\n\n#### Example:\n```javascript\nfunction isArraySorted(arr) {\n    for (let i = 0; i < arr.length - 1; i++) {\n        if (arr[i] > arr[i + 1]) {\n            return false;\n        }\n    }\n    return true;\n}\n\n// Example usage\nconsole.log(isArraySorted([1, 2, 3, 4])); // Output: true\nconsole.log(isArraySorted([1, 3, 2, 4])); // Output: false\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#check-if-two-strings-are-palindromes-of-each-other",
      "title": "Check if Two Strings Are Palindromes of Each Other",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Strings, Algorithm",
      "text": "### Check if Two Strings Are Palindromes of Each Other\n\nTo check if two strings are palindromes of each other, reverse one string and compare it with the other string.\n\n#### Algorithm:\n1. Reverse one of the strings.\n2. Compare the reversed string with the other string.\n3. If they are equal, return true, indicating that they are palindromes of each other.\n\n#### Example:\n```javascript\nfunction arePalindromes(str1, str2) {\n    return str1 === str2.split('').reverse().join('');\n}\n\n// Example usage\nconsole.log(arePalindromes('abcd', 'dcba')); // Output: true\nconsole.log(arePalindromes('abc', 'def')); // Output: false\n```\n\nThis method has a time complexity of O(n), where n is the length of the string."
    },
    {
      "link": "#count-the-number-of-1-bits-in-a-number",
      "title": "Count the Number of 1 Bits in a Number",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Bit Manipulation, Algorithm",
      "text": "### Count the Number of 1 Bits in a Number\n\nTo count the number of 1 bits in a number, use bitwise operations. The idea is to repeatedly clear the least significant 1 bit and count how many times this operation is performed.\n\n#### Algorithm:\n1. Initialize a counter variable to 0.\n2. Repeatedly perform the operation `n & (n - 1)` to clear the least significant 1 bit of `n`.\n3. Increment the counter for each operation.\n4. Return the counter.\n\n#### Example:\n```javascript\nfunction hammingWeight(n) {\n    let count = 0;\n    while (n !== 0) {\n        n &= (n - 1);\n        count++;\n    }\n    return count;\n}\n\n// Example usage\nconsole.log(hammingWeight(11)); // Output: 3 (binary: 1011)\nconsole.log(hammingWeight(128)); // Output: 1 (binary: 10000000)\n```\n\nThis method has a time complexity of O(k), where k is the number of 1 bits in the number."
    },
    {
      "link": "#count-the-occurences-of-an-element-in-an-array",
      "title": "Count the Occurrences of an Element in an Array",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Count the Occurrences of an Element in an Array\n\nTo count the occurrences of an element in an array, iterate through the array and keep track of how many times the element appears.\n\n#### Algorithm:\n1. Initialize a counter variable to 0.\n2. Iterate through the array and check if each element matches the target element.\n3. Increment the counter for each match.\n4. Return the counter.\n\n#### Example:\n```javascript\nfunction countOccurrences(arr, elem) {\n    let count = 0;\n\n    for (const item of arr) {\n        if (item === elem) {\n            count++;\n        }\n    }\n\n    return count;\n}\n\n// Example usage\nconsole.log(countOccurrences([1, 2, 3, 2, 4], 2)); // Output: 2\nconsole.log(countOccurrences([\"apple\", \"banana\", \"apple\"], \"apple\")); // Output: 2\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#count-vowels-in-a-string",
      "title": "Count Vowels in a String",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Strings, Algorithm",
      "text": "### Count Vowels in a String\n\nTo count the vowels in a string, iterate through the string and check if each character is a vowel.\n\n#### Algorithm:\n1. Normalize the string by converting it to lowercase to handle case insensitivity.\n2. Define a set or array containing all vowel characters (`a, e, i, o, u`).\n3. Iterate through the string and count characters that match any vowel.\n4. Return the total count of vowels.\n\n#### Example:\n```javascript\nfunction countVowels(str) {\n    const vowels = new Set(['a', 'e', 'i', 'o', 'u']);\n    let count = 0;\n\n    for (const char of str.toLowerCase()) {\n        if (vowels.has(char)) {\n            count++;\n        }\n    }\n\n    return count;\n}\n\n// Example usage\nconsole.log(countVowels(\"Hello World\")); // Output: 3\nconsole.log(countVowels(\"JavaScript is awesome!\")); // Output: 8\n```\n\nThis method has a time complexity of O(n), where n is the length of the string."
    },
    {
      "link": "#count-words-in-a-string",
      "title": "Count Words in a String",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Strings, Algorithm",
      "text": "### Count Words in a String\n\nTo count the number of words in a string, split the string by spaces and count the resulting elements.\n\n#### Algorithm:\n1. Split the string by spaces into an array of words.\n2. Filter out any empty strings from the array.\n3. Return the length of the array.\n\n#### Example:\n```javascript\nfunction countWords(str) {\n    return str.split(' ').filter(word => word !== '').length;\n}\n\n// Example usage\nconsole.log(countWords('Hello world, how are you?')); // Output: 5\nconsole.log(countWords('   This is a test   ')); // Output: 4\n```\n\nThis method has a time complexity of O(n), where n is the length of the string."
    },
    {
      "link": "#do-all-objects-have-prototypes",
      "title": "Do all objects have prototypes",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Objects",
      "text": "### Do all objects have prototypes?\n\nYes, in JavaScript, all objects inherit from `Object.prototype` by default, which means they have access to its methods and properties. However, objects created with `Object.create(null)` do not have a prototype.\n\nExample:\n\n```javascript\nlet obj = {};\nconsole.log(Object.getPrototypeOf(obj));  // Output: [object Object]\n```"
    },
    {
      "link": "#does-javascript-supports-namespace",
      "title": "Does JavaScript supports namespace",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, namespaces",
      "text": "### Does JavaScript support namespaces?\n\nJavaScript does not have a built-in `namespace` feature like some other programming languages. However, you can create a namespace-like structure using objects or modules.\n\nExample using objects as namespaces:\n\n```javascript\nconst MyNamespace = {\n  myFunction: function() { console.log('Hello!'); },\n  myVariable: 42\n};\nMyNamespace.myFunction(); // 'Hello!'\n```"
    },
    {
      "link": "#does-javascript-uses-mixins",
      "title": "Does javascript uses mixins",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Object-Oriented Programming",
      "text": "### Does JavaScript use mixins?\n\nYes, JavaScript can implement mixins, which are objects that provide methods to other objects. A mixin is a way to reuse functionality across different objects without using inheritance.\n\nExample:\n\n```javascript\nlet mixin = {\n  greet() { console.log('Hello!'); }\n};\n\nlet obj = Object.assign({}, mixin);\nobj.greet();  // Output: 'Hello!'\n```"
    },
    {
      "link": "#does-the-const-variable-make-the-value-immutable",
      "title": "Does the const variable make the value immutable",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Variables",
      "text": "### Does the `const` variable make the value immutable?\n\nNo, `const` only ensures that the variable identifier cannot be reassigned. It does not make the value immutable. If the value is an object or array, its properties or elements can still be modified.\n\nExample:\n\n```javascript\nconst arr = [1, 2, 3];\narr.push(4);  // Works fine\narr = [4, 5, 6];  // Error: Assignment to constant variable\n```"
    },
    {
      "link": "#find-all-pairs-in-an-array-with-a-given-sum",
      "title": "Find All Pairs in an Array with a Given Sum",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find All Pairs in an Array with a Given Sum\n\nTo find all pairs that sum to a specific target, use a hash set to track the complements of each element.\n\n#### Algorithm:\n1. Initialize an empty set to store elements.\n2. Iterate through the array and calculate the complement (target - current element).\n3. If the complement exists in the set, add the pair to the result.\n4. Otherwise, add the current element to the set.\n5. Return the list of pairs.\n\n#### Example:\n```javascript\nfunction findPairsWithSum(arr, target) {\n    const seen = new Set(), pairs = [];\n    for (let num of arr) {\n        const complement = target - num;\n        if (seen.has(complement)) {\n            pairs.push([complement, num]);\n        }\n        seen.add(num);\n    }\n    return pairs;\n}\n\n// Example usage\nconsole.log(findPairsWithSum([1, 2, 3, 4, 5], 5)); // Output: [[2, 3], [1, 4]]\nconsole.log(findPairsWithSum([10, 15, 3, 7], 17)); // Output: [[10, 7]]\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-all-pairs-that-sum-to-a-target",
      "title": "Find All Pairs That Sum to a Target",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find All Pairs That Sum to a Target\n\nTo find all pairs of numbers in an array that sum up to a target value, use a hash set to track the numbers seen so far and check if the complement of each number exists in the set.\n\n#### Algorithm:\n1. Initialize an empty set to store the numbers.\n2. Iterate through the array and for each number, check if the complement (target - number) is already in the set.\n3. If the complement exists, add the pair to the result array.\n4. If the complement doesn't exist, add the current number to the set.\n\n#### Example:\n```javascript\nfunction findPairs(arr, target) {\n    let pairs = [];\n    let seen = new Set();\n    for (let num of arr) {\n        let complement = target - num;\n        if (seen.has(complement)) {\n            pairs.push([complement, num]);\n        }\n        seen.add(num);\n    }\n    return pairs;\n}\n\n// Example usage\nconsole.log(findPairs([1, 2, 3, 4, 5], 5)); // Output: [[2, 3], [1, 4]]\nconsole.log(findPairs([1, 3, 2, 4, 5], 6)); // Output: [[1, 5], [2, 4]]\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-all-pairs-with-sum",
      "title": "Find All Pairs with a Given Sum",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find All Pairs with a Given Sum\n\nTo find all pairs in an array that sum up to a specific target value, use a hash set to track the numbers that can form pairs.\n\n#### Algorithm:\n1. Initialize an empty set to store numbers.\n2. Iterate through the array and for each element, check if the complement (target - current element) is in the set.\n3. If the complement exists, add the pair to the result array.\n4. If not, add the current element to the set.\n5. Return the array of pairs.\n\n#### Example:\n```javascript\nfunction findPairs(arr, target) {\n    const pairs = [];\n    const seen = new Set();\n    for (let num of arr) {\n        const complement = target - num;\n        if (seen.has(complement)) {\n            pairs.push([complement, num]);\n        }\n        seen.add(num);\n    }\n    return pairs;\n}\n\n// Example usage\nconsole.log(findPairs([1, 2, 3, 4, 5], 5)); // Output: [[1, 4], [2, 3]]\nconsole.log(findPairs([10, 15, 3, 7], 17)); // Output: [[10, 7]]\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-all-prime-numbers-in-a-range",
      "title": "Find All Prime Numbers in a Range",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Math, Algorithm",
      "text": "### Find All Prime Numbers in a Range\n\nTo find all prime numbers within a given range, use the Sieve of Eratosthenes algorithm to efficiently find primes.\n\n#### Algorithm:\n1. Create a boolean array `isPrime` where each index represents a number.\n2. Set all values to `true` except for 0 and 1.\n3. Starting from 2, mark all multiples of each prime as `false`.\n4. Return the indices that are still `true` as the prime numbers.\n\n#### Example:\n```javascript\nfunction sieveOfEratosthenes(limit) {\n    let isPrime = new Array(limit + 1).fill(true);\n    isPrime[0] = isPrime[1] = false;\n    for (let i = 2; i * i <= limit; i++) {\n        if (isPrime[i]) {\n            for (let j = i * i; j <= limit; j += i) {\n                isPrime[j] = false;\n            }\n        }\n    }\n    return isPrime.map((prime, index) => prime ? index : -1).filter(index => index !== -1);\n}\n\n// Example usage\nconsole.log(sieveOfEratosthenes(20)); // Output: [2, 3, 5, 7, 11, 13, 17, 19]\n```\n\nThis method has a time complexity of O(n log log n), where n is the limit."
    },
    {
      "link": "#find-all-prime-numbers-in-an-array",
      "title": "Find All Prime Numbers in an Array",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find All Prime Numbers in an Array\n\nTo find all prime numbers in an array, check each number in the array to see if it is prime.\n\n#### Algorithm:\n1. Define a helper function `isPrime` to check if a number is prime.\n2. Iterate through the array, calling `isPrime` on each element.\n3. Collect the prime numbers and return them.\n\n#### Example:\n```javascript\nfunction isPrime(num) {\n    if (num <= 1) return false;\n    for (let i = 2; i <= Math.sqrt(num); i++) {\n        if (num % i === 0) return false;\n    }\n    return true;\n}\n\nfunction findPrimes(arr) {\n    return arr.filter(isPrime);\n}\n\n// Example usage\nconsole.log(findPrimes([1, 2, 3, 4, 5, 6])); // Output: [2, 3, 5]\nconsole.log(findPrimes([10, 15, 23, 30])); // Output: [23]\n```\n\nThis method has a time complexity of O(n * sqrt(m)), where n is the length of the array and m is the largest number in the array."
    },
    {
      "link": "#find-all-subsets-of-an-array",
      "title": "Find All Subsets of an Array",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find All Subsets of an Array\n\nTo find all subsets of an array, use a bitwise approach. Each element can either be included or excluded from a subset, so there are `2^n` possible subsets.\n\n#### Algorithm:\n1. Initialize an empty array to store the subsets.\n2. Iterate over the range from 0 to `2^n - 1`.\n3. For each number in the range, use its binary representation to decide which elements to include in the subset.\n4. Return the array of subsets.\n\n#### Example:\n```javascript\nfunction getSubsets(arr) {\n    let subsets = [];\n    let n = arr.length;\n    for (let i = 0; i < (1 << n); i++) {\n        let subset = [];\n        for (let j = 0; j < n; j++) {\n            if (i & (1 << j)) {\n                subset.push(arr[j]);\n            }\n        }\n        subsets.push(subset);\n    }\n    return subsets;\n}\n\n// Example usage\nconsole.log(getSubsets([1, 2, 3]));\n// Output: [[], [1], [2], [1, 2], [3], [1, 3], [2, 3], [1, 2, 3]]\n```\n\nThis method has a time complexity of O(2^n), where n is the length of the array."
    },
    {
      "link": "#find-all-substrings-of-a-string",
      "title": "Find All Substrings of a String",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Strings, Algorithm",
      "text": "### Find All Substrings of a String\n\nTo find all substrings of a string, iterate through all possible starting and ending indices to extract substrings.\n\n#### Algorithm:\n1. Initialize an empty array to store substrings.\n2. Iterate through the string with two nested loops: one for the starting index and one for the ending index.\n3. Extract the substring for each pair of indices and add it to the result array.\n4. Return the array of substrings.\n\n#### Example:\n```javascript\nfunction findAllSubstrings(str) {\n    const substrings = [];\n    for (let i = 0; i < str.length; i++) {\n        for (let j = i + 1; j <= str.length; j++) {\n            substrings.push(str.slice(i, j));\n        }\n    }\n    return substrings;\n}\n\n// Example usage\nconsole.log(findAllSubstrings('abc')); // Output: ['a', 'ab', 'abc', 'b', 'bc', 'c']\nconsole.log(findAllSubstrings('hello')); // Output: ['h', 'he', 'hel', 'hell', 'hello', 'e', 'el', 'ell', 'ello', 'l', 'll', 'llo', 'l', 'lo', 'o']\n```\n\nThis method has a time complexity of O(n^2), where n is the length of the string."
    },
    {
      "link": "#find-common-characters-in-two-strings",
      "title": "Find Common Characters in Two Strings",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Strings, Algorithm",
      "text": "### Find Common Characters in Two Strings\n\nTo find common characters in two strings, use a frequency map for each string and compare the characters.\n\n#### Algorithm:\n1. Create a frequency map for each string to count the occurrences of each character.\n2. Compare the frequency maps to find common characters.\n3. Return the list of common characters.\n\n#### Example:\n```javascript\nfunction findCommonCharacters(str1, str2) {\n    const map1 = {}, map2 = {};\n    for (let char of str1) map1[char] = (map1[char] || 0) + 1;\n    for (let char of str2) map2[char] = (map2[char] || 0) + 1;\n    const common = [];\n    for (let char in map1) {\n        if (map2[char]) {\n            const count = Math.min(map1[char], map2[char]);\n            for (let i = 0; i < count; i++) common.push(char);\n        }\n    }\n    return common;\n}\n\n// Example usage\nconsole.log(findCommonCharacters('abc', 'cde')); // Output: ['c']\nconsole.log(findCommonCharacters('aabb', 'abcc')); // Output: ['a', 'b']\n```\n\nThis method has a time complexity of O(n + m), where n and m are the lengths of the two strings."
    },
    {
      "link": "#find-common-prefix-in-an-array-of-strings",
      "title": "Find Common Prefix in an Array of Strings",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find Common Prefix in an Array of Strings\n\nTo find the longest common prefix among an array of strings, compare characters from each string in the array.\n\n#### Algorithm:\n1. Initialize the first string in the array as the common prefix.\n2. Iterate through the rest of the strings, updating the common prefix by comparing it with each string.\n3. If no common prefix is found, return an empty string.\n4. Return the final common prefix.\n\n#### Example:\n```javascript\nfunction findCommonPrefix(arr) {\n    if (arr.length === 0) return \"\";\n\n    let prefix = arr[0];\n    for (let i = 1; i < arr.length; i++) {\n        while (arr[i].indexOf(prefix) !== 0) {\n            prefix = prefix.slice(0, prefix.length - 1);\n            if (prefix === \"\") return \"\";\n        }\n    }\n    return prefix;\n}\n\n// Example usage\nconsole.log(findCommonPrefix([\"flower\", \"flow\", \"flight\"])); // Output: \"fl\"\nconsole.log(findCommonPrefix([\"dog\", \"racecar\", \"car\"])); // Output: \"\"\n```\n\nThis method has a time complexity of O(n * m), where n is the length of the array and m is the length of the longest string."
    },
    {
      "link": "#find-duplicate-elements-in-an-array",
      "title": "Find Duplicate Elements in an Array",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find Duplicate Elements in an Array\n\nTo find duplicate elements in an array, use a set to track the elements you've seen as you iterate through the array.\n\n#### Algorithm:\n1. Initialize an empty set to store unique elements.\n2. Iterate through the array and check if each element is already in the set.\n3. If it is, add it to the result array.\n4. Return the array of duplicates.\n\n#### Example:\n```javascript\nfunction findDuplicates(arr) {\n    const seen = new Set();\n    const duplicates = [];\n\n    for (const num of arr) {\n        if (seen.has(num)) {\n            duplicates.push(num);\n        }\n        seen.add(num);\n    }\n\n    return duplicates;\n}\n\n// Example usage\nconsole.log(findDuplicates([1, 2, 3, 2, 4, 5, 1])); // Output: [2, 1]\nconsole.log(findDuplicates([\"apple\", \"banana\", \"apple\", \"orange\"])); // Output: [\"apple\"]\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-duplicates-in-an-array-without-extra-space",
      "title": "Find Duplicates in an Array Without Extra Space",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find Duplicates in an Array Without Extra Space\n\nTo find duplicates without using extra space, you can modify the array in-place.\n\n#### Algorithm:\n1. Iterate through the array and use the value of each element as an index.\n2. If the value at that index is negative, it means the element has been seen before, so it is a duplicate.\n3. If the value at that index is positive, make it negative to mark it as visited.\n4. Return the duplicates.\n\n#### Example:\n```javascript\nfunction findDuplicatesInPlace(arr) {\n    const duplicates = [];\n    for (let i = 0; i < arr.length; i++) {\n        const absVal = Math.abs(arr[i]);\n        if (arr[absVal] < 0) {\n            duplicates.push(absVal);\n        } else {\n            arr[absVal] = -arr[absVal];\n        }\n    }\n    return duplicates;\n}\n\n// Example usage\nconsole.log(findDuplicatesInPlace([4, 3, 2, 7, 8, 2, 3, 1])); // Output: [2, 3]\nconsole.log(findDuplicatesInPlace([1, 1, 1, 2, 2])); // Output: [1, 2]\n```\n\nThis method has a time complexity of O(n), where n is the length of the array, and does not use extra space."
    },
    {
      "link": "#find-if-a-number-is-prime",
      "title": "Find if a Number is Prime",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Math, Algorithm",
      "text": "### Find if a Number is Prime\n\nA prime number is a number greater than 1 that has no divisors other than 1 and itself. To check if a number is prime, iterate through numbers from 2 to the square root of the number.\n\n#### Algorithm:\n1. If the number is less than or equal to 1, return `false`.\n2. Check for divisibility by all numbers from 2 to the square root of the number.\n3. If any number divides evenly, return `false`. Otherwise, return `true`.\n\n#### Example:\n```javascript\nfunction isPrime(num) {\n    if (num <= 1) return false;\n    for (let i = 2; i <= Math.sqrt(num); i++) {\n        if (num % i === 0) return false;\n    }\n    return true;\n}\n\n// Example usage\nconsole.log(isPrime(7));  // Output: true\nconsole.log(isPrime(10)); // Output: false\n```\n\nThis method has a time complexity of O(sqrt(n)), where n is the number being checked."
    },
    {
      "link": "#find-if-a-string-is-rotated",
      "title": "Find if a String is Rotated",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Strings, Algorithm",
      "text": "### Find if a String is Rotated\n\nTo check if one string is a rotation of another, concatenate the second string with itself and check if the first string is a substring of the concatenated string.\n\n#### Algorithm:\n1. Concatenate the second string with itself.\n2. Check if the first string is a substring of the concatenated string.\n3. Return true if it is a substring, false otherwise.\n\n#### Example:\n```javascript\nfunction isRotated(str1, str2) {\n    if (str1.length !== str2.length) return false;\n    return (str2 + str2).includes(str1);\n}\n\n// Example usage\nconsole.log(isRotated('abc', 'bca')); // Output: true\nconsole.log(isRotated('abc', 'acb')); // Output: false\n```\n\nThis method has a time complexity of O(n), where n is the length of the string."
    },
    {
      "link": "#find-largest-palindrome-in-an-array",
      "title": "Find Largest Palindrome in an Array",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find Largest Palindrome in an Array\n\nTo find the largest palindrome in an array, iterate through the array and check each element to see if it is a palindrome.\n\n#### Algorithm:\n1. Iterate through the array and check if each element is a palindrome.\n2. Keep track of the largest palindrome found.\n3. Return the largest palindrome.\n\n#### Example:\n```javascript\nfunction isPalindrome(str) {\n    return str === str.split('').reverse().join('');\n}\n\nfunction largestPalindrome(arr) {\n    let largest = '';\n    for (let str of arr) {\n        if (isPalindrome(str) && str.length > largest.length) {\n            largest = str;\n        }\n    }\n    return largest;\n}\n\n// Example usage\nconsole.log(largestPalindrome(['madam', 'racecar', 'apple'])); // Output: 'racecar'\nconsole.log(largestPalindrome(['hello', 'world', 'civic'])); // Output: 'civic'\n```\n\nThis method has a time complexity of O(n * m), where n is the length of the array and m is the average length of the strings."
    },
    {
      "link": "#find-missing-number-in-an-array",
      "title": "Find the Missing Number in an Array",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Missing Number in an Array\n\nTo find the missing number in a sequential array, calculate the expected sum and subtract the actual sum of the array.\n\n#### Algorithm:\n1. Calculate the sum of numbers from 1 to n using the formula `n * (n + 1) / 2`.\n2. Calculate the sum of the elements in the array.\n3. Subtract the actual sum from the expected sum to find the missing number.\n\n#### Example:\n```javascript\nfunction findMissingNumber(arr) {\n    const n = arr.length + 1;\n    const expectedSum = (n * (n + 1)) / 2;\n    const actualSum = arr.reduce((sum, num) => sum + num, 0);\n\n    return expectedSum - actualSum;\n}\n\n// Example usage\nconsole.log(findMissingNumber([1, 2, 4, 5, 6])); // Output: 3\nconsole.log(findMissingNumber([3, 7, 1, 2, 8, 4, 5])); // Output: 6\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-the-average-of-an-array",
      "title": "Find the Average of an Array",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Average of an Array\n\nTo find the average of an array, sum all the elements in the array and then divide the sum by the number of elements.\n\n#### Algorithm:\n1. Initialize a variable to store the sum of the array elements.\n2. Iterate through the array and add each element to the sum.\n3. Divide the sum by the length of the array to get the average.\n4. Return the average.\n\n#### Example:\n```javascript\nfunction findAverage(arr) {\n    let sum = 0;\n    for (const num of arr) {\n        sum += num;\n    }\n    return sum / arr.length;\n}\n\n// Example usage\nconsole.log(findAverage([1, 2, 3, 4, 5])); // Output: 3\nconsole.log(findAverage([10, 20, 30])); // Output: 20\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-the-common-elements-between-two-arrays",
      "title": "Find the Common Elements Between Two Arrays",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Common Elements Between Two Arrays\n\nTo find common elements between two arrays, use a set to store the elements of one array and check for intersections with the other array.\n\n#### Algorithm:\n1. Convert the first array into a set.\n2. Iterate through the second array and check if each element exists in the set.\n3. If it does, add it to the result array.\n4. Return the result array.\n\n#### Example:\n```javascript\nfunction findCommonElements(arr1, arr2) {\n    const set1 = new Set(arr1);\n    const common = [];\n\n    for (const num of arr2) {\n        if (set1.has(num)) {\n            common.push(num);\n        }\n    }\n\n    return common;\n}\n\n// Example usage\nconsole.log(findCommonElements([1, 2, 3], [3, 4, 5])); // Output: [3]\nconsole.log(findCommonElements([\"a\", \"b\", \"c\"], [\"d\", \"b\", \"e\"])); // Output: [\"b\"]\n```\n\nThis method has a time complexity of O(n + m), where n and m are the lengths of the two arrays."
    },
    {
      "link": "#find-the-common-elements-in-two-arrays",
      "title": "Find the Common Elements in Two Arrays",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Common Elements in Two Arrays\n\nTo find the common elements in two arrays, you can use a set to track elements from one array and check if they exist in the other array.\n\n#### Algorithm:\n1. Create a set from the first array to store unique elements.\n2. Iterate through the second array and check if each element is present in the set.\n3. If an element is found in both arrays, add it to the result array.\n4. Return the array of common elements.\n\n#### Example:\n```javascript\nfunction findCommonElements(arr1, arr2) {\n    const set1 = new Set(arr1);\n    const common = [];\n\n    for (const elem of arr2) {\n        if (set1.has(elem)) {\n            common.push(elem);\n        }\n    }\n\n    return common;\n}\n\n// Example usage\nconsole.log(findCommonElements([1, 2, 3], [2, 3, 4])); // Output: [2, 3]\nconsole.log(findCommonElements([\"apple\", \"banana\"], [\"banana\", \"orange\"])); // Output: [\"banana\"]\n```\n\nThis method has a time complexity of O(n + m), where n and m are the lengths of the two arrays."
    },
    {
      "link": "#find-the-difference-between-two-arrays",
      "title": "Find the Difference Between Two Arrays",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Difference Between Two Arrays\n\nTo find the difference between two arrays, use a set to track elements that are in one array but not the other.\n\n#### Algorithm:\n1. Convert one array into a set for efficient lookup.\n2. Iterate through the second array and add elements that are not in the set to the result array.\n3. Return the resulting array of differences.\n\n#### Example:\n```javascript\nfunction arrayDifference(arr1, arr2) {\n    const set = new Set(arr1);\n    return arr2.filter(item => !set.has(item));\n}\n\n// Example usage\nconsole.log(arrayDifference([1, 2, 3], [3, 4, 5])); // Output: [4, 5]\nconsole.log(arrayDifference([1, 2, 3, 4], [3, 4, 5])); // Output: [5]\n```\n\nThis method has a time complexity of O(n + m), where n and m are the lengths of the two arrays."
    },
    {
      "link": "#find-the-duplicate-element-in-an-array",
      "title": "Find the Duplicate Element in an Array",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Duplicate Element in an Array\n\nTo find a duplicate element in an array, use a set to track the elements that have been seen. If an element is already in the set, it's a duplicate.\n\n#### Algorithm:\n1. Create an empty set to store elements.\n2. Iterate through the array.\n3. If the element is already in the set, return it as the duplicate.\n4. If the element is not in the set, add it to the set.\n\n#### Example:\n```javascript\nfunction findDuplicate(arr) {\n    let seen = new Set();\n    for (let num of arr) {\n        if (seen.has(num)) {\n            return num;\n        }\n        seen.add(num);\n    }\n    return null;\n}\n\n// Example usage\nconsole.log(findDuplicate([1, 2, 3, 4, 5, 3])); // Output: 3\nconsole.log(findDuplicate([1, 2, 3, 4, 5])); // Output: null\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-the-duplicate-elements-in-an-array",
      "title": "Find the Duplicate Elements in an Array",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Duplicate Elements in an Array\n\nTo find duplicate elements in an array, you can use a frequency map or set to track the elements that have already been encountered.\n\n#### Algorithm:\n1. Create a set to store elements you've seen.\n2. Iterate through the array and check if an element is already in the set.\n3. If it is, add it to the result array.\n4. If not, add it to the set.\n5. Return the result array with duplicates.\n\n#### Example:\n```javascript\nfunction findDuplicates(arr) {\n    let seen = new Set(), duplicates = [];\n    for (let num of arr) {\n        if (seen.has(num)) {\n            duplicates.push(num);\n        } else {\n            seen.add(num);\n        }\n    }\n    return duplicates;\n}\n\n// Example usage\nconsole.log(findDuplicates([1, 2, 3, 1, 4, 5, 3])); // Output: [1, 3]\nconsole.log(findDuplicates([10, 20, 30, 40])); // Output: []\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-the-duplicate-number-in-an-array",
      "title": "Find the Duplicate Number in an Array",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Duplicate Number in an Array\n\nTo find the duplicate number in an array, use a set to track numbers that have been encountered. If a number is encountered more than once, it's the duplicate.\n\n#### Algorithm:\n1. Initialize an empty set to track numbers.\n2. Iterate through the array, and for each element, check if it already exists in the set.\n3. If it does, return that element as the duplicate.\n4. If it does not, add the element to the set.\n\n#### Example:\n```javascript\nfunction findDuplicate(arr) {\n    const seen = new Set();\n    for (let num of arr) {\n        if (seen.has(num)) {\n            return num;\n        }\n        seen.add(num);\n    }\n    return null; // No duplicates found\n}\n\n// Example usage\nconsole.log(findDuplicate([1, 2, 3, 4, 5, 3])); // Output: 3\nconsole.log(findDuplicate([1, 2, 3, 4, 5])); // Output: null\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-the-first-index-of-an-element-in-an-array",
      "title": "Find the First Index of an Element in an Array",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the First Index of an Element in an Array\n\nTo find the first index of an element in an array, you can use the `indexOf` method.\n\n#### Algorithm:\n1. Use the `indexOf` method to search for the element in the array.\n2. If the element is found, return its index.\n3. If the element is not found, return `-1`.\n\n#### Example:\n```javascript\nfunction findFirstIndex(arr, elem) {\n    return arr.indexOf(elem);\n}\n\n// Example usage\nconsole.log(findFirstIndex([1, 2, 3, 4], 3)); // Output: 2\nconsole.log(findFirstIndex([\"apple\", \"banana\", \"cherry\"], \"banana\")); // Output: 1\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-the-first-missing-positive-integer",
      "title": "Find the First Missing Positive Integer",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the First Missing Positive Integer\n\nTo find the first missing positive integer in an unsorted array, use an in-place hash set technique to rearrange the elements and identify the missing number.\n\n#### Algorithm:\n1. Iterate through the array and move each number to its correct position (i.e., `arr[i] = i + 1`).\n2. After rearranging, find the first index where the value is not equal to `index + 1`.\n3. Return `index + 1` as the first missing positive integer.\n\n#### Example:\n```javascript\nfunction firstMissingPositive(nums) {\n    for (let i = 0; i < nums.length; i++) {\n        while (nums[i] > 0 && nums[i] <= nums.length && nums[nums[i] - 1] !== nums[i]) {\n            [nums[nums[i] - 1], nums[i]] = [nums[i], nums[nums[i] - 1]];\n        }\n    }\n    for (let i = 0; i < nums.length; i++) {\n        if (nums[i] !== i + 1) return i + 1;\n    }\n    return nums.length + 1;\n}\n\n// Example usage\nconsole.log(firstMissingPositive([1, 2, 0])); // Output: 3\nconsole.log(firstMissingPositive([3, 4, -1, 1])); // Output: 2\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-the-first-non-repeating-character",
      "title": "Find the First Non-Repeating Character",
      "url": "https://www.tiktok.com/@jsmentoring/video/7458383226621529376",
      "level": "intermediate",
      "theme": "JavaScript, Strings, Algorithm, Data Structures",
      "text": "### Find the First Non-Repeating Character\n\nTo find the first non-repeating character in a string, you can use a frequency counter to track character occurrences.\n\n#### Algorithm:\n1. Create an empty object to store character frequencies.\n2. Iterate through the string and count occurrences of each character by updating the object.\n3. Iterate through the string again and check the frequency of each character in the object.\n4. Return the first character with a frequency of 1.\n5. If no non-repeating character is found, return `null`.\n\n#### Example:\n```javascript\nfunction firstNonRepeatingChar(str) {\n    const charCount = {};\n\n    // Count occurrences of each character\n    for (const char of str) {\n        charCount[char] = (charCount[char] || 0) + 1;\n    }\n\n    // Find the first character with a count of 1\n    for (const char of str) {\n        if (charCount[char] === 1) {\n            return char;\n        }\n    }\n\n    return null; // Return null if no non-repeating character is found\n}\n\n// Example usage\nconsole.log(firstNonRepeatingChar(\"swiss\")); // Output: \"w\"\n```\n\nThis method has a time complexity of O(n) as it involves two iterations over the string."
    },
    {
      "link": "#find-the-first-repeated-character",
      "title": "Find the First Repeated Character",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Strings, Algorithm",
      "text": "### Find the First Repeated Character\n\nTo find the first repeated character in a string, use a frequency counter to track character occurrences.\n\n#### Algorithm:\n1. Initialize an empty set to track characters as you iterate through the string.\n2. For each character, check if it already exists in the set.\n3. If it does, return the character as the first repeated character.\n4. If no repeated character is found, return `null`.\n\n#### Example:\n```javascript\nfunction findFirstRepeatedChar(str) {\n    const seen = new Set();\n\n    for (const char of str) {\n        if (seen.has(char)) {\n            return char;\n        }\n        seen.add(char);\n    }\n\n    return null;\n}\n\n// Example usage\nconsole.log(findFirstRepeatedChar(\"abcdab\")); // Output: \"a\"\nconsole.log(findFirstRepeatedChar(\"abcdef\")); // Output: null\n```\n\nThis method has a time complexity of O(n), where n is the length of the string."
    },
    {
      "link": "#find-the-first-repeated-character-in-a-string",
      "title": "Find the First Repeated Character in a String",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Strings, Algorithm",
      "text": "### Find the First Repeated Character in a String\n\nTo find the first repeated character in a string, use a set to track characters that have been seen.\n\n#### Algorithm:\n1. Initialize an empty set to store characters.\n2. Iterate through the string, checking if each character has already been seen in the set.\n3. If a character is found in the set, return it as the first repeated character.\n4. If no repeated character is found, return `null`.\n\n#### Example:\n```javascript\nfunction findFirstRepeatedCharacter(str) {\n    const seen = new Set();\n    for (let char of str) {\n        if (seen.has(char)) return char;\n        seen.add(char);\n    }\n    return null;\n}\n\n// Example usage\nconsole.log(findFirstRepeatedCharacter('abcdeab')); // Output: 'a'\nconsole.log(findFirstRepeatedCharacter('abcdef')); // Output: null\n```\n\nThis method has a time complexity of O(n), where n is the length of the string."
    },
    {
      "link": "#find-the-first-repeating-character",
      "title": "Find the First Repeating Character",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Strings, Algorithm",
      "text": "### Find the First Repeating Character\n\nTo find the first repeating character in a string, use a set to track characters that have been seen. As you iterate through the string, check if the character is already in the set.\n\n#### Algorithm:\n1. Initialize an empty set to track seen characters.\n2. Iterate through the string.\n3. If a character is already in the set, return it as the first repeating character.\n4. If not, add it to the set.\n\n#### Example:\n```javascript\nfunction firstRepeatingCharacter(str) {\n    let seen = new Set();\n    for (let char of str) {\n        if (seen.has(char)) {\n            return char;\n        }\n        seen.add(char);\n    }\n    return null;\n}\n\n// Example usage\nconsole.log(firstRepeatingCharacter('abca')); // Output: 'a'\nconsole.log(firstRepeatingCharacter('abcdef')); // Output: null\n```\n\nThis method has a time complexity of O(n), where n is the length of the string."
    },
    {
      "link": "#find-the-first-repeating-element-in-an-array",
      "title": "Find the First Repeating Element in an Array",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the First Repeating Element in an Array\n\nTo find the first repeating element in an array, you can use a set to keep track of the elements you've already seen.\n\n#### Algorithm:\n1. Initialize an empty set to store the elements.\n2. Iterate through the array, checking if each element is in the set.\n3. If it is, return the element as the first repeating one.\n4. If no repeating element is found, return `null`.\n\n#### Example:\n```javascript\nfunction findFirstRepeating(arr) {\n    const seen = new Set();\n\n    for (const num of arr) {\n        if (seen.has(num)) {\n            return num;\n        }\n        seen.add(num);\n    }\n\n    return null;\n}\n\n// Example usage\nconsole.log(findFirstRepeating([1, 2, 3, 2, 4])); // Output: 2\nconsole.log(findFirstRepeating([5, 3, 4, 1])); // Output: null\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-the-greatest-common-divisor",
      "title": "Find the Greatest Common Divisor (GCD)",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Math, Algorithm",
      "text": "### Find the Greatest Common Divisor (GCD)\n\nTo find the GCD of two numbers, you can use the Euclidean algorithm.\n\n#### Algorithm:\n1. If `b` is 0, return `a` as the GCD.\n2. Otherwise, call the function recursively with `b` and `a % b` as the arguments.\n3. Repeat until the second number becomes 0.\n\n#### Example:\n```javascript\nfunction gcd(a, b) {\n    if (b === 0) return a;\n    return gcd(b, a % b);\n}\n\n// Example usage\nconsole.log(gcd(56, 98)); // Output: 14\nconsole.log(gcd(100, 25)); // Output: 25\n```\n\nThis method has a time complexity of O(log(min(a, b))), where a and b are the two numbers."
    },
    {
      "link": "#find-the-kth-largest-element-in-an-array",
      "title": "Find the Kth Largest Element in an Array",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Kth Largest Element in an Array\n\nTo find the Kth largest element in an array, you can sort the array in descending order and return the element at the Kth position.\n\n#### Algorithm:\n1. Sort the array in descending order.\n2. Return the element at index K-1.\n3. If K is larger than the length of the array, return `null`.\n\n#### Example:\n```javascript\nfunction findKthLargest(arr, k) {\n    arr.sort((a, b) => b - a);\n    return arr[k - 1] || null;\n}\n\n// Example usage\nconsole.log(findKthLargest([1, 3, 5, 2, 4], 2)); // Output: 4\nconsole.log(findKthLargest([7, 2, 9, 4], 3)); // Output: 4\n```\n\nThis method has a time complexity of O(n log n), where n is the length of the array due to sorting."
    },
    {
      "link": "#find-the-kth-smallest-element-in-an-array",
      "title": "Find the Kth Smallest Element in an Array",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Kth Smallest Element in an Array\n\nTo find the Kth smallest element in an array, use the Quickselect algorithm or sort the array and return the element at the Kth index.\n\n#### Algorithm (Quickselect):\n1. Select a pivot element from the array.\n2. Partition the array into two subarrays: one with elements smaller than the pivot, and one with elements larger.\n3. If the Kth element is in the smaller subarray, repeat the process with that subarray.\n4. If the Kth element is in the larger subarray, repeat the process with that subarray.\n5. Return the Kth smallest element.\n\n#### Example (using sorting):\n```javascript\nfunction kthSmallest(arr, k) {\n    arr.sort((a, b) => a - b);\n    return arr[k - 1];\n}\n\n// Example usage\nconsole.log(kthSmallest([7, 10, 4, 3, 20, 15], 4)); // Output: 10\nconsole.log(kthSmallest([12, 3, 5, 7, 19], 2)); // Output: 5\n```\n\nThis method has a time complexity of O(n log n) for sorting, where n is the length of the array."
    },
    {
      "link": "#find-the-largest-even-number-in-an-array",
      "title": "Find the Largest Even Number in an Array",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Largest Even Number in an Array\n\nTo find the largest even number in an array, iterate through the array and check each element for evenness, keeping track of the largest even number.\n\n#### Algorithm:\n1. Initialize a variable to store the largest even number, starting with a value like `-Infinity`.\n2. Iterate through the array and check if each element is even.\n3. If the element is even and larger than the current largest even number, update the largest even number.\n4. Return the largest even number.\n\n#### Example:\n```javascript\nfunction findLargestEven(arr) {\n    let largestEven = -Infinity;\n\n    for (const num of arr) {\n        if (num % 2 === 0 && num > largestEven) {\n            largestEven = num;\n        }\n    }\n\n    return largestEven === -Infinity ? null : largestEven;\n}\n\n// Example usage\nconsole.log(findLargestEven([1, 2, 3, 4, 5])); // Output: 4\nconsole.log(findLargestEven([7, 5, 9, 1])); // Output: null\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-the-largest-number-in-an-array",
      "title": "Find the Largest Number in an Array",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Largest Number in an Array\n\nTo find the largest number in an array, iterate through the array and keep track of the largest number.\n\n#### Algorithm:\n1. Initialize a variable to store the largest number with a small value (e.g., `-Infinity`).\n2. Iterate through the array and compare each element to the current largest number.\n3. Update the largest number whenever a larger element is found.\n4. Return the largest number.\n\n#### Example:\n```javascript\nfunction findLargest(arr) {\n    let largest = -Infinity;\n\n    for (const num of arr) {\n        if (num > largest) {\n            largest = num;\n        }\n    }\n\n    return largest;\n}\n\n// Example usage\nconsole.log(findLargest([5, 3, 8, 1, 6])); // Output: 8\nconsole.log(findLargest([7, 4, 9, 2])); // Output: 9\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-the-largest-palindrome-in-an-array",
      "title": "Find the Largest Palindrome in an Array",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Largest Palindrome in an Array\n\nTo find the largest palindrome in an array, iterate through the array and check if each number is a palindrome, keeping track of the largest one.\n\n#### Algorithm:\n1. Iterate through the array and check if each element is a palindrome.\n2. For each palindrome, compare it with the current largest palindrome.\n3. Return the largest palindrome found.\n\n#### Example:\n```javascript\nfunction isPalindrome(num) {\n    return num.toString() === num.toString().split('').reverse().join('');\n}\n\nfunction findLargestPalindrome(arr) {\n    let largest = -Infinity;\n    for (let num of arr) {\n        if (isPalindrome(num) && num > largest) {\n            largest = num;\n        }\n    }\n    return largest === -Infinity ? 'No palindrome found' : largest;\n}\n\n// Example usage\nconsole.log(findLargestPalindrome([121, 123, 232, 456])); // Output: 232\nconsole.log(findLargestPalindrome([123, 456, 789])); // Output: No palindrome found\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-the-largest-product-of-two-numbers-in-an-array",
      "title": "Find the Largest Product of Two Numbers in an Array",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Largest Product of Two Numbers in an Array\n\nTo find the largest product of two numbers in an array, iterate through the array while keeping track of the two largest numbers.\n\n#### Algorithm:\n1. Initialize two variables, `max1` and `max2`, to negative infinity.\n2. Iterate through the array, updating `max1` and `max2` as you find larger numbers.\n3. Return the product of `max1` and `max2`.\n\n#### Example:\n```javascript\nfunction largestProduct(arr) {\n    let max1 = -Infinity, max2 = -Infinity;\n    for (let num of arr) {\n        if (num > max1) {\n            max2 = max1;\n            max1 = num;\n        } else if (num > max2) {\n            max2 = num;\n        }\n    }\n    return max1 * max2;\n}\n\n// Example usage\nconsole.log(largestProduct([1, 2, 3, 4, 5])); // Output: 20\nconsole.log(largestProduct([-10, -10, 5, 2])); // Output: 100\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-the-largest-sum-of-consecutive-subarray",
      "title": "Find the Largest Sum of Consecutive Subarray",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Largest Sum of Consecutive Subarray\n\nTo find the largest sum of a consecutive subarray, you can use Kadane's Algorithm.\n\n#### Algorithm:\n1. Initialize two variables: `maxSum` and `currentSum`, both set to the first element of the array.\n2. Iterate through the array, updating `currentSum` to the larger of the current element or the sum of `currentSum` and the current element.\n3. Update `maxSum` to the larger of `maxSum` and `currentSum`.\n4. Return `maxSum`.\n\n#### Example:\n```javascript\nfunction maxSubArraySum(arr) {\n    let maxSum = arr[0], currentSum = arr[0];\n\n    for (let i = 1; i < arr.length; i++) {\n        currentSum = Math.max(arr[i], currentSum + arr[i]);\n        maxSum = Math.max(maxSum, currentSum);\n    }\n\n    return maxSum;\n}\n\n// Example usage\nconsole.log(maxSubArraySum([1, -2, 3, 4, -1, 2, 1, -5, 4])); // Output: 7\nconsole.log(maxSubArraySum([-2, -3, 4, -1, -2, 1, 5, -3])); // Output: 7\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-the-largest-sum-of-contiguous-subarray",
      "title": "Find the Largest Sum of Contiguous Subarray",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Largest Sum of Contiguous Subarray\n\nTo find the largest sum of a contiguous subarray, use Kadane's Algorithm, which helps to find the maximum sum efficiently in linear time.\n\n#### Algorithm:\n1. Initialize two variables, `maxCurrent` and `maxGlobal`, to the first element of the array.\n2. Iterate through the array starting from the second element.\n3. For each element, update `maxCurrent` to the maximum of the current element or the sum of the current element and `maxCurrent`.\n4. If `maxCurrent` exceeds `maxGlobal`, update `maxGlobal`.\n5. Return `maxGlobal` as the result.\n\n#### Example:\n```javascript\nfunction maxSubArraySum(arr) {\n    let maxCurrent = maxGlobal = arr[0];\n    for (let i = 1; i < arr.length; i++) {\n        maxCurrent = Math.max(arr[i], maxCurrent + arr[i]);\n        if (maxCurrent > maxGlobal) {\n            maxGlobal = maxCurrent;\n        }\n    }\n    return maxGlobal;\n}\n\n// Example usage\nconsole.log(maxSubArraySum([1, -2, 3, 4, -1, 2, 1, -5, 4])); // Output: 7\nconsole.log(maxSubArraySum([-1, -2, -3, -4])); // Output: -1\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-the-longest-common-prefix",
      "title": "Find the Longest Common Prefix",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Strings, Algorithm",
      "text": "### Find the Longest Common Prefix\n\nTo find the longest common prefix among a set of strings, iterate through the strings character by character and check if they match.\n\n#### Algorithm:\n1. Sort the array of strings.\n2. Compare the first and the last string character by character.\n3. The characters that match are the common prefix.\n4. Return the common prefix.\n\n#### Example:\n```javascript\nfunction longestCommonPrefix(strs) {\n    if (strs.length === 0) return '';\n    strs.sort();\n    let first = strs[0], last = strs[strs.length - 1];\n    let i = 0;\n    while (i < first.length && first[i] === last[i]) {\n        i++;\n    }\n    return first.substring(0, i);\n}\n\n// Example usage\nconsole.log(longestCommonPrefix(['flower', 'flow', 'flight'])); // Output: 'fl'\nconsole.log(longestCommonPrefix(['dog', 'racecar', 'car'])); // Output: ''\n```\n\nThis method has a time complexity of O(n log n), where n is the number of strings."
    },
    {
      "link": "#find-the-longest-increasing-subarray",
      "title": "Find the Longest Increasing Subarray",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Longest Increasing Subarray\n\nTo find the longest increasing subarray, iterate through the array and track the length of the current increasing subarray.\n\n#### Algorithm:\n1. Initialize variables to track the current and maximum subarray lengths.\n2. Iterate through the array and check if the current element is greater than the previous one.\n3. If the current element is greater, increment the current subarray length.\n4. If not, compare the current subarray length with the maximum length and reset the current subarray length.\n5. Return the maximum subarray length.\n\n#### Example:\n```javascript\nfunction longestIncreasingSubarray(arr) {\n    let maxLength = 1, currentLength = 1;\n\n    for (let i = 1; i < arr.length; i++) {\n        if (arr[i] > arr[i - 1]) {\n            currentLength++;\n            maxLength = Math.max(maxLength, currentLength);\n        } else {\n            currentLength = 1;\n        }\n    }\n\n    return maxLength;\n}\n\n// Example usage\nconsole.log(longestIncreasingSubarray([1, 2, 3, 1, 2, 3, 4])); // Output: 4\nconsole.log(longestIncreasingSubarray([5, 4, 3, 2, 1])); // Output: 1\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-the-longest-increasing-subsequence",
      "title": "Find the Longest Increasing Subsequence",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Longest Increasing Subsequence\n\nThe longest increasing subsequence (LIS) is a subsequence of a given array where the elements are in strictly increasing order. The goal is to find the length of the LIS.\n\n#### Algorithm:\n1. Initialize an array `dp` where `dp[i]` stores the length of the longest increasing subsequence that ends at index `i`.\n2. Iterate through the array, and for each element, check all previous elements to see if it can form a longer subsequence.\n3. Return the maximum value in `dp`.\n\n#### Example:\n```javascript\nfunction lengthOfLIS(nums) {\n    if (nums.length === 0) return 0;\n    let dp = new Array(nums.length).fill(1);\n    for (let i = 1; i < nums.length; i++) {\n        for (let j = 0; j < i; j++) {\n            if (nums[i] > nums[j]) {\n                dp[i] = Math.max(dp[i], dp[j] + 1);\n            }\n        }\n    }\n    return Math.max(...dp);\n}\n\n// Example usage\nconsole.log(lengthOfLIS([10, 9, 2, 5, 3, 7, 101, 18])); // Output: 4\n```\n\nThis method has a time complexity of O(n^2), where n is the length of the array."
    },
    {
      "link": "#find-the-longest-palindrome-in-a-string",
      "title": "Find the Longest Palindrome in a String",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Strings, Algorithm",
      "text": "### Find the Longest Palindrome in a String\n\nTo find the longest palindrome in a string, expand around each character and check for the longest palindromic substring.\n\n#### Algorithm:\n1. Initialize variables to store the start and end indices of the longest palindrome.\n2. For each character in the string, expand outwards while the characters on both sides match.\n3. Track the maximum length of palindrome found during the expansion.\n4. Return the longest palindromic substring.\n\n#### Example:\n```javascript\nfunction longestPalindrome(s) {\n    let start = 0, end = 0;\n    for (let i = 0; i < s.length; i++) {\n        let len1 = expandAroundCenter(s, i, i);\n        let len2 = expandAroundCenter(s, i, i + 1);\n        let len = Math.max(len1, len2);\n        if (len > (end - start)) {\n            start = i - Math.floor((len - 1) / 2);\n            end = i + Math.floor(len / 2);\n        }\n    }\n    return s.substring(start, end + 1);\n}\n\nfunction expandAroundCenter(s, left, right) {\n    while (left >= 0 && right < s.length && s[left] === s[right]) {\n        left--;\n        right++;\n    }\n    return right - left - 1;\n}\n\n// Example usage\nconsole.log(longestPalindrome('babad')); // Output: 'bab' or 'aba'\nconsole.log(longestPalindrome('cbbd')); // Output: 'bb'\n```\n\nThis method has a time complexity of O(n^2), where n is the length of the string."
    },
    {
      "link": "#find-the-longest-substring-without-repeating-characters",
      "title": "Find the Longest Substring Without Repeating Characters",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Strings, Algorithm",
      "text": "### Find the Longest Substring Without Repeating Characters\n\nTo find the longest substring without repeating characters, use a sliding window technique with two pointers to track the current substring.\n\n#### Algorithm:\n1. Initialize two pointers, one for the start and one for the end of the window.\n2. Move the end pointer to expand the window and add characters to a set.\n3. If a character is already in the set, move the start pointer to shrink the window and remove the character from the set.\n4. Keep track of the maximum window length.\n5. Return the maximum length of the substring.\n\n#### Example:\n```javascript\nfunction longestSubstring(str) {\n    let start = 0, maxLength = 0, seen = new Set();\n    for (let end = 0; end < str.length; end++) {\n        while (seen.has(str[end])) {\n            seen.delete(str[start]);\n            start++;\n        }\n        seen.add(str[end]);\n        maxLength = Math.max(maxLength, end - start + 1);\n    }\n    return maxLength;\n}\n\n// Example usage\nconsole.log(longestSubstring('abcabcbb')); // Output: 3\nconsole.log(longestSubstring('bbbbb')); // Output: 1\n```\n\nThis method has a time complexity of O(n), where n is the length of the string."
    },
    {
      "link": "#find-the-longest-word-in-a-sentence",
      "title": "Find the Longest Word in a Sentence",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Strings, Algorithm",
      "text": "### Find the Longest Word in a Sentence\n\nTo find the longest word in a sentence, split the sentence into words and compare their lengths.\n\n#### Algorithm:\n1. Remove any non-alphanumeric characters except spaces to clean the input.\n2. Split the sentence into an array of words using spaces as the delimiter.\n3. Iterate through the array, keeping track of the longest word encountered.\n4. Return the longest word. If there are multiple words of the same length, return the first one encountered.\n\n#### Example:\n```javascript\nfunction findLongestWord(sentence) {\n    // Normalize the sentence: remove non-alphanumeric characters except spaces\n    const words = sentence.replace(/[^a-zA-Z0-9\\s]/g, '').split(' ');\n\n    let longestWord = '';\n\n    for (const word of words) {\n        if (word.length > longestWord.length) {\n            longestWord = word;\n        }\n    }\n\n    return longestWord;\n}\n\n// Example usage\nconsole.log(findLongestWord(\"The quick brown fox jumps over the lazy dog.\")); // Output: \"jumps\"\nconsole.log(findLongestWord(\"Hello world!\")); // Output: \"Hello\"\n```\n\nThis method has a time complexity of O(n), where n is the total number of characters in the sentence."
    },
    {
      "link": "#find-the-majority-element",
      "title": "Find the Majority Element",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Majority Element\n\nThe majority element in an array is the element that appears more than `n/2` times. The Boyer-Moore Voting Algorithm is an efficient way to find this element.\n\n#### Algorithm:\n1. Initialize a candidate element and a count variable.\n2. Iterate through the array, updating the count based on the current element.\n3. If the count becomes 0, set the current element as the new candidate.\n4. After the first pass, the candidate will be the majority element if it exists.\n\n#### Example:\n```javascript\nfunction majorityElement(arr) {\n    let candidate = null;\n    let count = 0;\n    for (let num of arr) {\n        if (count === 0) {\n            candidate = num;\n        }\n        count += (num === candidate) ? 1 : -1;\n    }\n    return candidate;\n}\n\n// Example usage\nconsole.log(majorityElement([3, 3, 4, 2, 4, 4, 2, 4, 4])); // Output: 4\nconsole.log(majorityElement([1, 2, 3, 4, 5])); // Output: 5 (or no majority)\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-the-majority-element-in-an-array",
      "title": "Find the Majority Element in an Array",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Majority Element in an Array\n\nTo find the majority element in an array (an element that appears more than n/2 times), use the Boyer-Moore Voting Algorithm.\n\n#### Algorithm:\n1. Initialize a `candidate` variable and a `count` variable.\n2. Iterate through the array. If the count is 0, set the current element as the `candidate` and set `count` to 1. If the current element is the `candidate`, increment the count, otherwise decrement it.\n3. Return the `candidate`.\n\n#### Example:\n```javascript\nfunction majorityElement(nums) {\n    let candidate = null, count = 0;\n    for (let num of nums) {\n        if (count === 0) {\n            candidate = num;\n        }\n        count += (num === candidate) ? 1 : -1;\n    }\n    return candidate;\n}\n\n// Example usage\nconsole.log(majorityElement([3, 2, 3])); // Output: 3\nconsole.log(majorityElement([1, 2, 3, 4])); // Output: null\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-the-maximum-number-in-an-array",
      "title": "Find the Maximum Number in an Array",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Maximum Number in an Array\n\nTo find the maximum number in an array, iterate through the array and keep track of the largest value encountered.\n\n#### Algorithm:\n1. Initialize a variable to store the maximum value. Start with the first element of the array.\n2. Iterate through the array, comparing each element with the current maximum.\n3. If an element is greater than the current maximum, update the maximum.\n4. Return the maximum value after completing the iteration.\n\n#### Example:\n```javascript\nfunction findMaxNumber(arr) {\n    if (arr.length === 0) {\n        throw new Error(\"Array is empty\");\n    }\n\n    let max = arr[0];\n\n    for (const num of arr) {\n        if (num > max) {\n            max = num;\n        }\n    }\n\n    return max;\n}\n\n// Example usage\nconsole.log(findMaxNumber([3, 1, 4, 1, 5, 9])); // Output: 9\nconsole.log(findMaxNumber([-10, -20, -3, -7])); // Output: -3\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-the-median-of-an-array",
      "title": "Find the Median of an Array",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Median of an Array\n\nTo find the median of an array, first sort the array and then find the middle element.\n\n#### Algorithm:\n1. Sort the array in ascending order.\n2. If the array has an odd length, return the middle element.\n3. If the array has an even length, return the average of the two middle elements.\n\n#### Example:\n```javascript\nfunction findMedian(arr) {\n    arr.sort((a, b) => a - b);\n    const mid = Math.floor(arr.length / 2);\n    return arr.length % 2 !== 0 ? arr[mid] : (arr[mid - 1] + arr[mid]) / 2;\n}\n\n// Example usage\nconsole.log(findMedian([1, 3, 5, 2, 4])); // Output: 3\nconsole.log(findMedian([7, 1, 2, 8])); // Output: 4.5\n```\n\nThis method has a time complexity of O(n log n), where n is the length of the array."
    },
    {
      "link": "#find-the-middle-element-of-an-array",
      "title": "Find the Middle Element of an Array",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Middle Element of an Array\n\nTo find the middle element of an array, calculate the index of the middle and return the corresponding element.\n\n#### Algorithm:\n1. If the array length is odd, the middle element is the element at index `Math.floor(arr.length / 2)`.\n2. If the array length is even, you can choose either of the two middle elements.\n3. Return the middle element.\n\n#### Example:\n```javascript\nfunction findMiddleElement(arr) {\n    const middleIndex = Math.floor(arr.length / 2);\n    return arr[middleIndex];\n}\n\n// Example usage\nconsole.log(findMiddleElement([1, 2, 3, 4, 5])); // Output: 3\nconsole.log(findMiddleElement([10, 20, 30, 40])); // Output: 30\n```\n\nThis method has a time complexity of O(1), as it directly accesses the middle element."
    },
    {
      "link": "#find-the-missing-number-in-an-array",
      "title": "Find the Missing Number in an Array",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Missing Number in an Array\n\nTo find the missing number in an array that contains all numbers from 1 to n except one, you can use the sum formula of an arithmetic series.\n\n#### Algorithm:\n1. Calculate the expected sum of the numbers from 1 to n using the formula `n * (n + 1) / 2`.\n2. Calculate the actual sum of the elements in the array.\n3. Subtract the actual sum from the expected sum to find the missing number.\n\n#### Example:\n```javascript\nfunction findMissingNumber(arr) {\n    let n = arr.length + 1;\n    let expectedSum = (n * (n + 1)) / 2;\n    let actualSum = arr.reduce((sum, num) => sum + num, 0);\n    return expectedSum - actualSum;\n}\n\n// Example usage\nconsole.log(findMissingNumber([1, 2, 4, 5])); // Output: 3\nconsole.log(findMissingNumber([1, 3, 4, 5])); // Output: 2\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-the-mode-of-an-array",
      "title": "Find the Mode of an Array",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Mode of an Array\n\nTo find the mode (most frequent element) of an array, use an object to count the occurrences of each element.\n\n#### Algorithm:\n1. Initialize an empty object to store counts of elements.\n2. Iterate through the array, updating the count for each element.\n3. Find the element with the highest count.\n4. Return the element with the highest frequency.\n\n#### Example:\n```javascript\nfunction findMode(arr) {\n    const counts = {};\n    let maxCount = 0;\n    let mode = null;\n\n    for (let num of arr) {\n        counts[num] = (counts[num] || 0) + 1;\n        if (counts[num] > maxCount) {\n            maxCount = counts[num];\n            mode = num;\n        }\n    }\n\n    return mode;\n}\n\n// Example usage\nconsole.log(findMode([1, 2, 3, 3, 4, 5])); // Output: 3\nconsole.log(findMode([10, 10, 10, 5, 5, 1])); // Output: 10\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-the-most-frequent-element-in-an-array",
      "title": "Find the Most Frequent Element in an Array",
      "url": "https://www.tiktok.com/@jsmentoring/video/7458418483282316576",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm, Data Structures",
      "text": "### Find the Most Frequent Element in an Array\n\nTo find the most frequent element in an array, you can use a frequency counter to track occurrences of each element.\n\n#### Algorithm:\n1. Create an empty object to store element frequencies.\n2. Iterate through the array and count occurrences of each element by updating the object.\n3. Keep track of the element with the highest frequency while iterating through the object.\n4. Return the element with the highest frequency.\n\n#### Example:\n```javascript\nfunction findMostFrequentElement(arr) {\n    const frequency = {};\n    let maxFreq = 0;\n    let mostFrequent = null;\n\n    // Count occurrences of each element\n    for (const elem of arr) {\n        frequency[elem] = (frequency[elem] || 0) + 1;\n        if (frequency[elem] > maxFreq) {\n            maxFreq = frequency[elem];\n            mostFrequent = elem;\n        }\n    }\n\n    return mostFrequent;\n}\n\n// Example usage\nconsole.log(findMostFrequentElement([1, 3, 2, 1, 4, 1, 3, 3])); // Output: 1\nconsole.log(findMostFrequentElement([\"apple\", \"banana\", \"apple\", \"orange\", \"banana\", \"apple\"])); // Output: \"apple\"\n```\n\nThis method has a time complexity of O(n) as it involves a single iteration over the array."
    },
    {
      "link": "#find-the-second-largest-element-in-an-array",
      "title": "Find the Second Largest Element in an Array",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Second Largest Element in an Array\n\nTo find the second largest element in an array, iterate through the array and keep track of the largest and second largest elements.\n\n#### Algorithm:\n1. Initialize two variables, `largest` and `secondLargest`, with a very small value (e.g., `-Infinity`).\n2. Iterate through the array, updating `largest` and `secondLargest` as needed.\n3. Return the second largest element.\n\n#### Example:\n```javascript\nfunction findSecondLargest(arr) {\n    let largest = -Infinity, secondLargest = -Infinity;\n\n    for (const num of arr) {\n        if (num > largest) {\n            secondLargest = largest;\n            largest = num;\n        } else if (num > secondLargest && num < largest) {\n            secondLargest = num;\n        }\n    }\n\n    return secondLargest;\n}\n\n// Example usage\nconsole.log(findSecondLargest([5, 2, 8, 3, 1])); // Output: 5\nconsole.log(findSecondLargest([10, 10, 9, 8])); // Output: 9\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-the-second-largest-number-in-an-array",
      "title": "Find the Second Largest Number in an Array",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Second Largest Number in an Array\n\nTo find the second largest number in an array, iterate through the array and keep track of the largest and second largest elements.\n\n#### Algorithm:\n1. Initialize two variables, `first` and `second`, to `-Infinity`.\n2. Iterate through the array, and for each element, check if it is greater than `first`.\n3. If it is, update `second` to `first` and then update `first` to the current element.\n4. If the element is smaller than `first` but greater than `second`, update `second`.\n5. Return `second` as the second largest element.\n\n#### Example:\n```javascript\nfunction findSecondLargest(arr) {\n    let first = -Infinity, second = -Infinity;\n    for (let num of arr) {\n        if (num > first) {\n            second = first;\n            first = num;\n        } else if (num > second && num !== first) {\n            second = num;\n        }\n    }\n    return second;\n}\n\n// Example usage\nconsole.log(findSecondLargest([10, 20, 4, 45, 99])); // Output: 45\nconsole.log(findSecondLargest([1, 1, 1])); // Output: -Infinity\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-the-second-smallest-number-in-an-array",
      "title": "Find the Second Smallest Number in an Array",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Second Smallest Number in an Array\n\nTo find the second smallest number in an array, iterate through the array while keeping track of the smallest and second smallest values.\n\n#### Algorithm:\n1. Initialize two variables to store the smallest and second smallest values, starting with `Infinity`.\n2. Iterate through the array and update the smallest and second smallest values as you go.\n3. Return the second smallest number.\n\n#### Example:\n```javascript\nfunction findSecondSmallest(arr) {\n    let smallest = Infinity;\n    let secondSmallest = Infinity;\n\n    for (const num of arr) {\n        if (num < smallest) {\n            secondSmallest = smallest;\n            smallest = num;\n        } else if (num < secondSmallest && num > smallest) {\n            secondSmallest = num;\n        }\n    }\n\n    return secondSmallest === Infinity ? null : secondSmallest;\n}\n\n// Example usage\nconsole.log(findSecondSmallest([5, 3, 8, 1, 6])); // Output: 3\nconsole.log(findSecondSmallest([1, 1, 1])); // Output: null\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-the-smallest-element-in-an-array",
      "title": "Find the Smallest Element in an Array",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Smallest Element in an Array\n\nTo find the smallest element in an array, iterate through the array and keep track of the smallest element.\n\n#### Algorithm:\n1. Initialize a variable to store the smallest element with a large value (e.g., `Infinity`).\n2. Iterate through the array and compare each element to the current smallest value.\n3. Update the smallest value whenever a smaller element is found.\n4. Return the smallest value.\n\n#### Example:\n```javascript\nfunction findSmallest(arr) {\n    let smallest = Infinity;\n\n    for (const num of arr) {\n        if (num < smallest) {\n            smallest = num;\n        }\n    }\n\n    return smallest;\n}\n\n// Example usage\nconsole.log(findSmallest([5, 3, 8, 1, 6])); // Output: 1\nconsole.log(findSmallest([7, 4, 9, 2])); // Output: 2\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-the-smallest-number-in-an-array",
      "title": "Find the Smallest Number in an Array",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Smallest Number in an Array\n\nTo find the smallest number in an array, iterate through the array and keep track of the smallest value encountered.\n\n#### Algorithm:\n1. Initialize a variable to store the smallest value, starting with the first element of the array.\n2. Iterate through the array and compare each element with the current smallest value.\n3. If an element is smaller than the current smallest, update the smallest value.\n4. Return the smallest value after completing the iteration.\n\n#### Example:\n```javascript\nfunction findSmallestNumber(arr) {\n    if (arr.length === 0) {\n        throw new Error('Array is empty');\n    }\n\n    let smallest = arr[0];\n\n    for (const num of arr) {\n        if (num < smallest) {\n            smallest = num;\n        }\n    }\n\n    return smallest;\n}\n\n// Example usage\nconsole.log(findSmallestNumber([3, 1, 4, 1, 5, 9])); // Output: 1\nconsole.log(findSmallestNumber([-10, -20, -3, -7])); // Output: -20\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-the-unique-element-in-an-array",
      "title": "Find the Unique Element in an Array",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Unique Element in an Array\n\nTo find the unique element in an array, use the XOR operation, as XOR of a number with itself is 0, and XOR of a number with 0 is the number itself.\n\n#### Algorithm:\n1. Initialize a variable `unique` to 0.\n2. Iterate through the array, applying XOR to each element and the `unique` variable.\n3. The result will be the unique element in the array.\n\n#### Example:\n```javascript\nfunction findUnique(arr) {\n    let unique = 0;\n    for (let num of arr) {\n        unique ^= num;\n    }\n    return unique;\n}\n\n// Example usage\nconsole.log(findUnique([1, 2, 3, 2, 1])); // Output: 3\nconsole.log(findUnique([4, 4, 5, 5, 6])); // Output: 6\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-the-unique-elements-in-an-array",
      "title": "Find the Unique Elements in an Array",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find the Unique Elements in an Array\n\nTo find the unique elements in an array (elements that appear only once), you can use a frequency count with the help of an object or a `Map`.\n\n#### Algorithm:\n1. Create a frequency map to count the occurrences of each element in the array.\n2. Filter the array to return elements that appear only once.\n3. Return the filtered result.\n\n#### Example:\n```javascript\nfunction findUniqueElements(arr) {\n    let frequency = new Map();\n    arr.forEach(item => frequency.set(item, (frequency.get(item) || 0) + 1));\n    return arr.filter(item => frequency.get(item) === 1);\n}\n\n// Example usage\nconsole.log(findUniqueElements([1, 2, 2, 3, 4, 4])); // Output: [1, 3]\nconsole.log(findUniqueElements([5, 6, 7, 5, 6])); // Output: [7]\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#find-unique-characters-in-a-string",
      "title": "Find Unique Characters in a String",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Strings, Algorithm",
      "text": "### Find Unique Characters in a String\n\nTo find unique characters in a string, you can use a set to keep track of characters you've seen.\n\n#### Algorithm:\n1. Initialize an empty set.\n2. Iterate through the string and add each character to the set.\n3. Return the characters in the set as a string.\n\n#### Example:\n```javascript\nfunction findUniqueChars(str) {\n    const uniqueChars = new Set(str);\n    return [...uniqueChars].join('');\n}\n\n// Example usage\nconsole.log(findUniqueChars('aabbcc')); // Output: 'abc'\nconsole.log(findUniqueChars('hello')); // Output: 'helo'\n```\n\nThis method has a time complexity of O(n), where n is the length of the string."
    },
    {
      "link": "#find-unique-elements-in-an-array",
      "title": "Find Unique Elements in an Array",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Find Unique Elements in an Array\n\nTo find unique elements in an array, you can use a set to filter out duplicates.\n\n#### Algorithm:\n1. Convert the array to a set, which automatically removes duplicates.\n2. Convert the set back to an array to get the unique elements.\n3. Return the unique array.\n\n#### Example:\n```javascript\nfunction findUnique(arr) {\n    return [...new Set(arr)];\n}\n\n// Example usage\nconsole.log(findUnique([1, 2, 2, 3, 4, 4])); // Output: [1, 2, 3, 4]\nconsole.log(findUnique([\"apple\", \"banana\", \"apple\"])); // Output: [\"apple\", \"banana\"]\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#give-an-example-of-statements-affected-by-automatic-semicolon-insertion",
      "title": "Give an example of statements affected by automatic semicolon insertion?",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Syntax",
      "text": "### Give an example of statements affected by automatic semicolon insertion\n\nAutomatic Semicolon Insertion (ASI) can lead to unexpected behavior when a semicolon is inserted incorrectly.\n\nExample:\n```javascript\nfunction test() {\n  return\n  {\n    key: 'value'\n  };\n}\n\nconsole.log(test()); // undefined\n```\n\nExplanation:\n- ASI inserts a semicolon after `return`, so the object is never returned. The correct version:\n\n```javascript\nfunction test() {\n  return {\n    key: 'value'\n  };\n}\n\nconsole.log(test()); // { key: 'value' }\n```"
    },
    {
      "link": "#give-an-example-usage-of-rangeoverflow-property",
      "title": "Give an example usage of rangeOverflow property",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, DOM, validation",
      "text": "### Give an example usage of rangeOverflow property\n\nThe `rangeOverflow` property checks if the value entered in an input field exceeds the maximum value specified by the `max` attribute.\n\nExample:\n\n```html\n<input type=\"number\" id=\"age\" min=\"18\" max=\"100\">\n<script>\n  const input = document.getElementById('age');\n  if (input.validity.rangeOverflow) {\n    console.log('Value exceeds the maximum limit!');\n  }\n</script>\n```"
    },
    {
      "link": "#how-can-you-get-the-list-of-keys-of-any-object",
      "title": "How can you get the list of keys of any object",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### How can you get the list of keys of any object?\n\nYou can use `Object.keys()` to get an array of the object's keys (property names).\n\nExample:\n\n```javascript\nconst person = { name: 'John', age: 30 };\nconst keys = Object.keys(person);\nconsole.log(keys); // ['name', 'age']\n```"
    },
    {
      "link": "#how-do-get-query-string-values-in-javascript",
      "title": "How do get query string values in javascript",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7455462347759471905",
      "level": "basic",
      "theme": "JavaScript, web navigation",
      "text": "### How do you get query string values in JavaScript?\n\nTo get query string values, you can use the `URLSearchParams` object.\n\n```javascript\nconst params = new URLSearchParams(window.location.search);\nconsole.log(params.get('id')); // Gets the value of the 'id' parameter\n```"
    },
    {
      "link": "#how-do-get-the-timezone-offset-from-date",
      "title": "How do get the timezone offset from date",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Date",
      "text": "### How do you get the timezone offset from date?\n\nYou can get the timezone offset from a `Date` object in JavaScript using the `getTimezoneOffset()` method. This method returns the difference between UTC and the local time, in minutes.\n\nExample:\n\n```javascript\nconst date = new Date();\nconst offset = date.getTimezoneOffset();\nconsole.log(offset); // Logs the timezone offset in minutes\n```"
    },
    {
      "link": "#how-do-i-modify-the-url-without-reloading-the-page",
      "title": "How do I modify the url without reloading the page",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, URL manipulation",
      "text": "### How do I modify the url without reloading the page?\n\nYou can modify the URL without reloading the page using the `history.pushState()` or `history.replaceState()` methods. These methods allow you to change the URL in the browser without triggering a page reload.\n\nExample using `pushState`:\n\n```javascript\nhistory.pushState(null, '', '/new-url');\nconsole.log(window.location.href); // '/new-url'\n```"
    },
    {
      "link": "#how-do-style-the-console-output-using-css",
      "title": "How do style the console output using CSS?",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Console",
      "text": "### How do style the console output using CSS?\n\nYou can style the console output by using `%c` in the `console.log` method:\n\n```javascript\nconsole.log('%cStyled Text', 'color: red; font-size: 20px;');\n```\n\nThe second argument specifies the CSS styles to apply to the text."
    },
    {
      "link": "#how-do-you-add-a-key-value-pair-in-javascript",
      "title": "How do you add a key value pair in javascript",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456001248484003104",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### How do you add a key-value pair in JavaScript?\n\nTo add a key-value pair to an object, you can simply assign a value to a new key.\n\n```javascript\nconst obj = {};\nobj.name = 'John';\nconsole.log(obj); // { name: 'John' }\n```"
    },
    {
      "link": "#how-do-you-assign-default-values-to-variables",
      "title": "How do you assign default values to variables",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456018568077937953",
      "level": "basic",
      "theme": "JavaScript, variables",
      "text": "### How do you assign default values to variables?\n\nYou can assign default values to variables using the `||` operator or by using destructuring assignment.\n\n```javascript\nconst name = userInput || 'Default Name';\n```"
    },
    {
      "link": "#how-do-you-avoid-receiving-postmessages-from-attackers",
      "title": "How do you avoid receiving postMessages from attackers",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Security",
      "text": "### How do you avoid receiving postMessages from attackers?\n\nTo prevent receiving messages from attackers, always validate the `origin` property of the message and ensure it matches the trusted source. You can also check the message's content for additional security.\n\nExample:\n\n```javascript\nwindow.addEventListener('message', (event) => {\n  if (event.origin !== 'https://trusted.com') {\n    return;\n  }\n  // Process message\n});\n```"
    },
    {
      "link": "#how-do-you-call-the-constructor-of-a-parent-class",
      "title": "How do you call the constructor of a parent class",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, classes",
      "text": "### How do you call the constructor of a parent class?\n\nIn JavaScript, you can call the constructor of a parent class using the `super()` keyword inside the child class’s constructor. This allows the child class to inherit properties and methods from the parent class.\n\nExample:\n\n```javascript\nclass Animal {\n  constructor(name) {\n    this.name = name;\n  }\n}\nclass Dog extends Animal {\n  constructor(name, breed) {\n    super(name); // Calls the parent constructor\n    this.breed = breed;\n  }\n}\nconst dog = new Dog('Rex', 'German Shepherd');\nconsole.log(dog.name); // Rex\n```"
    },
    {
      "link": "#how-do-you-capture-browser-back-button",
      "title": "How do you capture browser back button",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Browser Events",
      "text": "### How do you capture browser back button?\n\nYou can capture the browser's back button by listening to the `popstate` event. This event is triggered when the active history entry changes.\n\nExample:\n\n```javascript\nwindow.addEventListener('popstate', function(event) {\n  console.log('Back button was pressed');\n});\n```"
    },
    {
      "link": "#how-do-you-change-the-style-of-a-html-element",
      "title": "How do you change the style of a HTML element",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456849197690621217",
      "level": "basic",
      "theme": "JavaScript, DOM manipulation",
      "text": "### How do you change the style of a HTML element?\n\nYou can change the style of an HTML element by accessing its `style` property in JavaScript.\n\nExample:\n\n```javascript\nconst element = document.getElementById('myElement');\nelement.style.backgroundColor = 'blue';\n```"
    },
    {
      "link": "#how-do-you-check-an-object-is-a-promise-or-not",
      "title": "How do you check an object is a promise or not",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Promises",
      "text": "### How do you check if an object is a promise or not?\n\nTo check if an object is a promise, verify that it is an object with a `then` method that is a function.\n\nExample:\n\n```javascript\nfunction isPromise(obj) {\n  return !!obj && typeof obj.then === 'function';\n}\n\nconsole.log(isPromise(Promise.resolve()));  // Output: true\nconsole.log(isPromise({}));  // Output: false\n```"
    },
    {
      "link": "#how-do-you-check-if-a-key-exists-in-an-object",
      "title": "How do you check if a key exists in an object",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7455464658166680864",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### How do you check if a key exists in an object?\n\nYou can check if a key exists in an object using the `in` operator or the `hasOwnProperty()` method.\n\n```javascript\nconst obj = {name: 'John'};\nconsole.log('name' in obj); // true\nconsole.log(obj.hasOwnProperty('name')); // true\n```"
    },
    {
      "link": "#how-do-you-check-if-a-string-starts-with-another-string",
      "title": "How do you check if a string starts with another string",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7455819349048315169",
      "level": "basic",
      "theme": "JavaScript, string manipulation",
      "text": "### How do you check if a string starts with another string?\n\nYou can use the `startsWith()` method to check if a string starts with a given substring.\n\n```javascript\nconst str = 'Hello World';\nconsole.log(str.startsWith('Hello')); // true\n```"
    },
    {
      "link": "#how-do-you-check-whether-a-string-contains-a-substring",
      "title": "How do you check whether a string contains a substring",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7457960152197614880",
      "level": "basic",
      "theme": "JavaScript, string manipulation",
      "text": "### How do you check whether a string contains a substring?\n\nTo check if a string contains a substring, you can use the `includes()` method, which returns `true` if the substring is found.\n\n```javascript\nconst str = 'Hello World';\nconsole.log(str.includes('World')); // true\n```"
    },
    {
      "link": "#how-do-you-check-whether-an-array-includes-a-particular-value-or-not",
      "title": "How do you check whether an array includes a particular value or not",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, arrays",
      "text": "### How do you check whether an array includes a particular value or not?\n\nIn JavaScript, you can use the `includes()` method to check if an array contains a particular value. This method returns `true` if the array contains the specified element, and `false` otherwise.\n\nExample:\n\n```javascript\nconst arr = [1, 2, 3, 4, 5];\nconsole.log(arr.includes(3)); // true\nconsole.log(arr.includes(6)); // false\n```"
    },
    {
      "link": "#how-do-you-check-whether-an-object-can-be-extendable-or-not",
      "title": "How do you check whether an object can be extendable or not",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### How do you check whether an object can be extendable or not?\n\nYou can check whether an object is extensible (i.e., if new properties can be added) using the `Object.isExtensible()` method. This method returns `true` if the object is extensible, and `false` if it is not.\n\nExample:\n\n```javascript\nconst obj = {};\nconsole.log(Object.isExtensible(obj)); // true\nObject.preventExtensions(obj);\nconsole.log(Object.isExtensible(obj)); // false\n```"
    },
    {
      "link": "#how-do-you-combine-two-or-more-arrays",
      "title": "How do you combine two or more arrays",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays",
      "text": "### How do you combine two or more arrays?\n\nYou can combine two or more arrays in JavaScript using methods like `concat()` or the spread operator (`...`).\n\nExample using `concat()`:\n\n```javascript\nlet arr1 = [1, 2];\nlet arr2 = [3, 4];\nlet combined = arr1.concat(arr2);\nconsole.log(combined);  // Output: [1, 2, 3, 4]\n```"
    },
    {
      "link": "#how-do-you-compare-scalar-arrays",
      "title": "How do you compare scalar arrays",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, arrays",
      "text": "### How do you compare scalar arrays?\n\nTo compare scalar arrays (arrays with primitive data types) in JavaScript, you need to check if both arrays have the same length and if each element is equal. You can do this using loops or `Array.prototype.every()`.\n\nExample:\n\n```javascript\nconst arr1 = [1, 2, 3];\nconst arr2 = [1, 2, 3];\nconst areArraysEqual = arr1.length === arr2.length && arr1.every((val, index) => val === arr2[index]);\nconsole.log(areArraysEqual); // true\n```"
    },
    {
      "link": "#how-do-you-compare-two-date-objects",
      "title": "How do you compare two date objects",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7455822418272062752",
      "level": "basic",
      "theme": "JavaScript, date and time",
      "text": "### How do you compare two date objects?\n\nTo compare two date objects, you can use `getTime()` method, which returns the time value in milliseconds.\n\n```javascript\nconst date1 = new Date('2024-12-01');\nconst date2 = new Date('2024-12-01');\nconsole.log(date1.getTime() === date2.getTime()); // true\n```"
    },
    {
      "link": "#how-do-you-convert-character-to-ascii-code",
      "title": "How do you convert character to ASCII code",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, String Manipulation",
      "text": "### How do you convert character to ASCII code?\n\nIn JavaScript, you can convert a character to its ASCII code using the `charCodeAt()` method. This method returns the Unicode (ASCII) value of the character at the specified index.\n\nExample:\n\n```javascript\nlet char = 'A';\nconsole.log(char.charCodeAt(0));  // Output: 65\n```"
    },
    {
      "link": "#how-do-you-convert-date-to-another-timezone-in-javascript",
      "title": "How do you convert date to another timezone in javascript",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7457198473176190241",
      "level": "basic",
      "theme": "JavaScript, date manipulation",
      "text": "### How do you convert date to another timezone in javascript?\n\nYou can use libraries like `moment.js` or the `Intl.DateTimeFormat` API to convert dates to different time zones.\n\nExample with `Intl.DateTimeFormat`:\n\n```javascript\nconst date = new Date();\nconst formatter = new Intl.DateTimeFormat('en-US', {\n  timeZone: 'America/New_York',\n  hour: 'numeric',\n  minute: 'numeric'\n});\nconsole.log(formatter.format(date));\n```"
    },
    {
      "link": "#how-do-you-copy-properties-from-one-object-to-other",
      "title": "How do you copy properties from one object to other",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7458032154656673056",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### How do you copy properties from one object to other?\n\nYou can copy properties from one object to another using `Object.assign()` or the spread operator.\n\nExample using `Object.assign()`:\n\n```javascript\nconst obj1 = { name: 'John' };\nconst obj2 = Object.assign({}, obj1);\nconsole.log(obj2); // { name: 'John' }\n```\nExample using the spread operator:\n\n```javascript\nconst obj2 = { ...obj1 };\nconsole.log(obj2); // { name: 'John' }\n```"
    },
    {
      "link": "#how-do-you-create-an-array-with-some-data",
      "title": "How do you create an array with some data",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays",
      "text": "### How do you create an array with some data?\n\nYou can create an array in JavaScript using array literals or the `Array` constructor. The simplest way is to use square brackets `[]` and add elements inside.\n\nExample:\n\n```javascript\nlet arr = [1, 2, 3, 4, 5];\nconsole.log(arr);  // Output: [1, 2, 3, 4, 5]\n```"
    },
    {
      "link": "#how-do-you-create-an-infinite-loop",
      "title": "How do you create an infinite loop",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Loops",
      "text": "### How do you create an infinite loop?\n\nAn infinite loop occurs when a loop condition always evaluates to `true`, causing the loop to run forever. Be cautious when creating infinite loops to avoid freezing your program.\n\nExample:\n\n```javascript\nwhile (true) {\n  console.log('This is an infinite loop');\n}\n```"
    },
    {
      "link": "#how-do-you-create-an-object-with-prototype",
      "title": "How do you create an object with prototype",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7458574988463983904",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### How do you create an object with prototype?\n\nYou can create an object with a prototype using `Object.create()`. This allows you to specify an existing object to serve as the prototype for the new object.\n\nExample:\n\n```javascript\nconst person = { greet() { console.log('Hello'); } };\nconst student = Object.create(person);\nstudent.greet(); // 'Hello'\n```"
    },
    {
      "link": "#how-do-you-create-copy-to-clipboard-button",
      "title": "How do you create copy to clipboard button",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, DOM",
      "text": "### How do you create copy to clipboard button?\n\nYou can create a 'copy to clipboard' button using the `document.execCommand('copy')` method. However, modern browsers prefer using the `Clipboard API` for better security and compatibility.\n\nExample using `Clipboard API`:\n\n```javascript\nlet copyButton = document.querySelector('#copyButton');\nlet textToCopy = document.querySelector('#textToCopy');\n\ncopyButton.addEventListener('click', () => {\n  navigator.clipboard.writeText(textToCopy.textContent)\n    .then(() => { console.log('Text copied to clipboard!'); })\n    .catch(err => { console.log('Failed to copy text:', err); });\n});\n```"
    },
    {
      "link": "#how-do-you-create-custom-html-element",
      "title": "How do you create custom HTML element?",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Web Components",
      "text": "### How do you create custom HTML element?\n\nYou can create a custom HTML element using the `customElements.define` method. Here's an example:\n\n```javascript\nclass MyElement extends HTMLElement {\n  constructor() {\n    super();\n    this.innerHTML = '<p>Hello, Custom Element!</p>';\n  }\n}\n\ncustomElements.define('my-element', MyElement);\n\n// Usage in HTML:\n// <my-element></my-element>\n```\n\nThis defines a new custom element `<my-element>` which can be used like a standard HTML tag."
    },
    {
      "link": "#how-do-you-create-polyfills-for-map-filter-and-reduce-methods",
      "title": "How do you create polyfills for map, filter and reduce methods?",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Polyfills",
      "text": "### How do you create polyfills for `map`, `filter`, and `reduce` methods?\n\n#### `map` Polyfill:\n```javascript\nArray.prototype.myMap = function(callback) {\n  const result = [];\n  for (let i = 0; i < this.length; i++) {\n    if (this.hasOwnProperty(i)) {\n      result.push(callback(this[i], i, this));\n    }\n  }\n  return result;\n};\n```\n\n#### `filter` Polyfill:\n```javascript\nArray.prototype.myFilter = function(callback) {\n  const result = [];\n  for (let i = 0; i < this.length; i++) {\n    if (this.hasOwnProperty(i) && callback(this[i], i, this)) {\n      result.push(this[i]);\n    }\n  }\n  return result;\n};\n```\n\n#### `reduce` Polyfill:\n```javascript\nArray.prototype.myReduce = function(callback, initialValue) {\n  let accumulator = initialValue;\n  for (let i = 0; i < this.length; i++) {\n    if (this.hasOwnProperty(i)) {\n      accumulator = callback(accumulator, this[i], i, this);\n    }\n  }\n  return accumulator;\n};\n```"
    },
    {
      "link": "#how-do-you-create-self-string-using-special-characters",
      "title": "How do you create self string using special characters",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Strings",
      "text": "### How do you create self string using special characters?\n\nTo create a string that includes special characters like quotes, newlines, or tabs, you can use escape sequences. For example, `\\'` for a single quote, `\\\"` for a double quote, `\\\\` for a backslash, `\\n` for a newline, and `\\t` for a tab.\n\nExample:\n\n```javascript\nlet str = 'This is a string with special characters: \\' \\\" \\\\ \\n';\nconsole.log(str);\n```"
    },
    {
      "link": "#how-do-you-create-specific-number-of-copies-of-a-string",
      "title": "How do you create specific number of copies of a string",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, String Manipulation",
      "text": "### How do you create specific number of copies of a string?\n\nYou can repeat a string a specific number of times using the `repeat()` method.\n\nExample:\n\n```javascript\nlet str = 'Hello ';\nlet repeatedStr = str.repeat(3);\nconsole.log(repeatedStr);  // Output: 'Hello Hello Hello '\n```"
    },
    {
      "link": "#how-do-you-create-your-own-bind-method-using-either-call-or-apply-method",
      "title": "How do you create your own bind method using either call or apply method?",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Functions",
      "text": "### How do you create your own bind method using either call or apply method?\n\nYou can create a custom `bind` method by using `call` or `apply` to explicitly set the `this` context.\n\nExample:\n\n```javascript\nFunction.prototype.customBind = function(context, ...args) {\n  const fn = this;\n  return function(...innerArgs) {\n    return fn.apply(context, [...args, ...innerArgs]);\n  };\n};\n\nfunction greet(greeting, name) {\n  console.log(`${greeting}, ${name}!`);\n}\n\nconst boundGreet = greet.customBind(null, 'Hello');\nboundGreet('Alice'); // 'Hello, Alice!'\n```"
    },
    {
      "link": "#how-do-you-declare-namespace",
      "title": "How do you declare namespace",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, namespaces",
      "text": "### How do you declare namespace?\n\nIn JavaScript, namespaces are not natively supported, but you can simulate them using objects or modules. By declaring an object, you can encapsulate your functions and variables to avoid polluting the global scope.\n\nExample using objects as namespaces:\n\n```javascript\nconst MyNamespace = {\n  myFunction: function() { console.log('Hello!'); },\n  myVariable: 42\n};\nMyNamespace.myFunction(); // 'Hello!'\n```"
    },
    {
      "link": "#how-do-you-decode-an-url",
      "title": "How do you decode an URL",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, encoding",
      "text": "### How do you decode an URL?\n\nYou can use `decodeURIComponent()` to decode a URL-encoded string back into its original format.\n\nExample:\n\n```javascript\nconst encodedURL = 'https%3A%2F%2Fexample.com%2F%3Fname%3DJohn%20Doe';\nconst decodedURL = decodeURIComponent(encodedURL);\nconsole.log(decodedURL); // 'https://example.com/?name=John Doe'\n```"
    },
    {
      "link": "#how-do-you-define-instance-and-non-instance-properties",
      "title": "How do you define instance and non-instance properties",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, OOP",
      "text": "### How do you define instance and non-instance properties?\n\n- **Instance Properties**:\n  - Defined within the constructor using `this`.\n  - Specific to each instance of a class.\n\n- **Non-Instance Properties**:\n  - Defined on the class itself (static properties).\n  - Shared across all instances.\n\nExample:\n\n```javascript\nclass Example {\n  constructor(name) {\n    this.name = name; // Instance property\n  }\n  static type = 'Example'; // Non-instance property\n}\nconsole.log(Example.type); // Output: 'Example'\n```"
    },
    {
      "link": "#how-do-you-define-json-arrays",
      "title": "How do you define JSON arrays",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456895653067672864",
      "level": "basic",
      "theme": "JavaScript, JSON",
      "text": "### How do you define JSON arrays?\n\nJSON arrays are defined in the same way as JavaScript arrays, but they must be in a string format. They can hold any type of data (strings, numbers, objects, etc.).\n\nExample:\n\n```json\n[\"apple\", \"banana\", \"cherry\"]\n```"
    },
    {
      "link": "#how-do-you-define-multiline-strings",
      "title": "How do you define multiline strings",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456061031811419424",
      "level": "basic",
      "theme": "JavaScript, string manipulation",
      "text": "### How do you define multiline strings?\n\nYou can define multiline strings using template literals (backticks).\n\n```javascript\nconst str = `Hello\nWorld`;\nconsole.log(str); // 'Hello\nWorld'\n```"
    },
    {
      "link": "#how-do-you-define-multiple-properties-on-an-object",
      "title": "How do you define multiple properties on an object",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### How do you define multiple properties on an object?\n\nYou can define multiple properties on an object in JavaScript by using either object literal syntax or `Object.defineProperties()` method.\n\nExample using object literal:\n\n```javascript\nconst person = { name: 'John', age: 30 };\n```\n\nExample using `Object.defineProperties()`:\n\n```javascript\nconst person = {};\nObject.defineProperties(person, {\n  name: { value: 'John', writable: true },\n  age: { value: 30, writable: true }\n});\nconsole.log(person);\n```"
    },
    {
      "link": "#how-do-you-define-property-on-object-constructor",
      "title": "How do you define property on Object constructor",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### How do you define property on Object constructor?\n\nYou can define properties on an object constructor by adding properties directly within the constructor function.\n\nExample:\n\n```javascript\nfunction Person(name, age) {\n  this.name = name;\n  this.age = age;\n}\nconst person = new Person('John', 30);\nconsole.log(person.name); // 'John'\nconsole.log(person.age); // 30\n```"
    },
    {
      "link": "#how-do-you-detect-a-browser-language-preference",
      "title": "How do you detect a browser language preference",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, browser features",
      "text": "### How do you detect a browser language preference?\n\nYou can detect the browser’s preferred language using `navigator.language` or `navigator.languages`.\n\nExample:\n\n```javascript\nconsole.log(navigator.language); // 'en-US'\n```"
    },
    {
      "link": "#how-do-you-detect-a-mobile-browser",
      "title": "How do you detect a mobile browser",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, mobile detection",
      "text": "### How do you detect a mobile browser?\n\nYou can detect a mobile browser by checking the `navigator.userAgent` string for keywords like 'mobile', 'Android', or 'iPhone'.\n\nExample:\n\n```javascript\nif (/Mobi/.test(navigator.userAgent)) {\n  console.log('Mobile browser detected');\n}\n```"
    },
    {
      "link": "#how-do-you-detect-a-mobile-browser-without-regexp",
      "title": "How do you detect a mobile browser without regexp",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7457202437292674337",
      "level": "basic",
      "theme": "JavaScript, mobile detection",
      "text": "### How do you detect a mobile browser without regexp?\n\nYou can detect a mobile browser without using regular expressions by checking for specific properties in `navigator` or `window` objects, such as `navigator.platform` or `window.innerWidth`.\n\nExample:\n\n```javascript\nif (navigator.platform.indexOf('iPhone') !== -1) {\n  console.log('iPhone detected');\n}\n```"
    },
    {
      "link": "#how-do-you-detect-javascript-disabled-in-the-page",
      "title": "How do you detect javascript disabled in the page",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7457508448763120928",
      "level": "basic",
      "theme": "JavaScript, page features",
      "text": "### How do you detect JavaScript disabled in the page?\n\nYou can detect JavaScript being disabled by using `<noscript>` HTML tag. This tag contains content that will only be displayed if JavaScript is disabled.\n\nExample:\n\n```html\n<noscript>\n  JavaScript is disabled in your browser.\n</noscript>\n```"
    },
    {
      "link": "#how-do-you-detect-primitive-or-non-primitive-value-type",
      "title": "How do you detect primitive or non primitive value type",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Data Types",
      "text": "### How do you detect primitive or non-primitive value type?\n\nIn JavaScript, you can detect whether a value is primitive or non-primitive by using the `typeof` operator for primitives and checking for `null` or using `instanceof` for non-primitives.\n\n- **Primitive types**: `undefined`, `null`, `boolean`, `number`, `string`, `symbol`, `bigint`\n- **Non-primitive types**: `object`, `array`, `function`\n\nExample:\n\n```javascript\nlet value = 42;\nconsole.log(typeof value);  // Output: 'number'\nlet obj = {};\nconsole.log(typeof obj);  // Output: 'object'\n```"
    },
    {
      "link": "#how-do-you-determine-if-an-object-is-sealed-or-not",
      "title": "How do you determine if an object is sealed or not",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### How do you determine if an object is sealed or not?\n\nYou can use `Object.isSealed()` to check if an object is sealed. A sealed object cannot have new properties added to it, but its existing properties can be modified.\n\nExample:\n\n```javascript\nconst person = { name: 'John' };\nObject.seal(person);\nconsole.log(Object.isSealed(person)); // true\n```"
    },
    {
      "link": "#how-do-you-determine-two-values-same-or-not-using-object",
      "title": "How do you determine two values same or not using object",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7457684535661137185",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### How do you determine two values same or not using object?\n\nYou can use `Object.is()` to determine if two values are the same. It checks both values for equality, including `NaN` and `-0`.\n\nExample:\n\n```javascript\nconsole.log(Object.is(5, 5)); // true\nconsole.log(Object.is(5, '5')); // false\nconsole.log(Object.is(NaN, NaN)); // true\n```"
    },
    {
      "link": "#how-do-you-determine-whether-object-is-frozen-or-not",
      "title": "How do you determine whether object is frozen or not",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7457681827478785312",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### How do you determine whether object is frozen or not?\n\nYou can use `Object.isFrozen()` to check if an object is frozen. A frozen object cannot have its properties modified, added, or removed.\n\nExample:\n\n```javascript\nconst person = { name: 'John' };\nObject.freeze(person);\nconsole.log(Object.isFrozen(person)); // true\n```"
    },
    {
      "link": "#how-do-you-disable-right-click-in-the-web-page",
      "title": "How do you disable right click in the web page",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, DOM",
      "text": "### How do you disable right click in the web page?\n\nYou can disable right-click by listening for the `contextmenu` event and preventing its default behavior.\n\nExample:\n\n```javascript\ndocument.addEventListener('contextmenu', function(event) {\n  event.preventDefault();\n  console.log('Right-click is disabled');\n});\n```"
    },
    {
      "link": "#how-do-you-display-data-in-a-tabular-format-using-console-object",
      "title": "How do you display data in a tabular format using console object",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Console",
      "text": "### How do you display data in a tabular format using console object?\n\nYou can use the `console.table()` method to display data in a tabular format. This is especially useful when dealing with arrays of objects.\n\nExample:\n\n```javascript\nlet arr = [\n  { name: 'Alice', age: 25 },\n  { name: 'Bob', age: 30 }\n];\nconsole.table(arr);\n```"
    },
    {
      "link": "#how-do-you-display-the-current-date-in-javascript",
      "title": "How do you display the current date in javascript",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, date and time",
      "text": "### How do you display the current date in JavaScript?\n\nTo display the current date, you can use the `Date` object.\n\n```javascript\nconst currentDate = new Date();\nconsole.log(currentDate); // Displays the current date and time\n```"
    },
    {
      "link": "#how-do-you-empty-an-array",
      "title": "How do you empty an array",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays",
      "text": "### How do you empty an array?\n\nThere are multiple ways to empty an array in JavaScript. You can set its length to `0`, use `splice()`, or create a new empty array.\n\nExample:\n\n```javascript\nlet arr = [1, 2, 3];\narr.length = 0;\nconsole.log(arr);  // Output: []\n```"
    },
    {
      "link": "#how-do-you-encode-an-url",
      "title": "How do you encode an URL",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, encoding",
      "text": "### How do you encode an URL?\n\nYou can use `encodeURIComponent()` to encode individual components of a URL, such as query parameters.\n\nExample:\n\n```javascript\nconst url = 'https://example.com/?name=John Doe';\nconst encodedURL = encodeURIComponent(url);\nconsole.log(encodedURL); // 'https%3A%2F%2Fexample.com%2F%3Fname%3DJohn%20Doe'\n```"
    },
    {
      "link": "#how-do-you-extend-classes",
      "title": "How do you extend classes",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, classes",
      "text": "### How do you extend classes?\n\nIn JavaScript, you can extend a class using the `extends` keyword. This allows a subclass to inherit properties and methods from a parent class.\n\nExample:\n\n```javascript\nclass Animal {\n  constructor(name) {\n    this.name = name;\n  }\n  speak() {\n    console.log(`${this.name} makes a sound`);\n  }\n}\nclass Dog extends Animal {\n  speak() {\n    console.log(`${this.name} barks`);\n  }\n}\nconst dog = new Dog('Buddy');\ndog.speak(); // 'Buddy barks'\n```"
    },
    {
      "link": "#how-do-you-find-min-and-max-value-in-an-array",
      "title": "How do you find min and max value in an array",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, arrays",
      "text": "### How do you find min and max value in an array?\n\nYou can find the minimum and maximum values in an array using the `Math.min()` and `Math.max()` methods combined with the spread operator (`...`).\n\nExample:\n\n```javascript\nconst arr = [1, 2, 3, 4, 5];\nconsole.log(Math.min(...arr)); // 1\nconsole.log(Math.max(...arr)); // 5\n```"
    },
    {
      "link": "#how-do-you-find-min-and-max-values-without-math-functions",
      "title": "How do you find min and max values without Math functions",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, arrays",
      "text": "### How do you find min and max values without Math functions?\n\nYou can find the minimum and maximum values in an array by manually iterating over the array and comparing each element.\n\nExample:\n\n```javascript\nconst arr = [1, 2, 3, 4, 5];\nlet min = arr[0], max = arr[0];\nfor (let i = 1; i < arr.length; i++) {\n  if (arr[i] < min) min = arr[i];\n  if (arr[i] > max) max = arr[i];\n}\nconsole.log(min); // 1\nconsole.log(max); // 5\n```"
    },
    {
      "link": "#how-do-you-find-operating-system-details",
      "title": "How do you find operating system details",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7451589366285126944",
      "level": "intermediate",
      "theme": "JavaScript, environment",
      "text": "### How do you find operating system details?\n\nYou can access the operating system details in JavaScript using `navigator.platform` or `navigator.userAgent` to detect the platform or OS of the user."
    },
    {
      "link": "#how-do-you-flattening-multi-dimensional-arrays",
      "title": "How do you flatten multi dimensional arrays",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays",
      "text": "### How do you flatten multi-dimensional arrays?\n\nYou can flatten multi-dimensional arrays using the `flat()` method in JavaScript. This method flattens an array up to a specified depth.\n\nExample:\n\n```javascript\nlet arr = [1, [2, 3], [4, [5, 6]]];\nlet flattened = arr.flat(2);\nconsole.log(flattened);  // Output: [1, 2, 3, 4, 5, 6]\n```"
    },
    {
      "link": "#how-do-you-generate-random-integers",
      "title": "How do you generate random integers",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456916623870512417",
      "level": "basic",
      "theme": "JavaScript, math",
      "text": "### How do you generate random integers?\n\nYou can use `Math.random()` and `Math.floor()` to generate random integers.\n\nExample:\n\n```javascript\nconst randomInt = Math.floor(Math.random() * 10); // Generates a random integer between 0 and 9\nconsole.log(randomInt);\n```"
    },
    {
      "link": "#how-do-you-get-enumerable-key-and-value-pairs",
      "title": "How do you get enumerable key and value pairs",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7458348252274920736",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### How do you get enumerable key and value pairs?\n\nYou can use `Object.entries()` to get enumerable key-value pairs from an object. This method returns an array of arrays, where each sub-array contains a key-value pair.\n\nExample:\n\n```javascript\nconst person = { name: 'John', age: 30 };\nconst entries = Object.entries(person);\nconsole.log(entries); // [['name', 'John'], ['age', 30]]\n```"
    },
    {
      "link": "#how-do-you-get-metadata-of-a-module",
      "title": "How do you get metadata of a module",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, modules",
      "text": "### How do you get metadata of a module?\n\nIn JavaScript, modules can be inspected using the `import.meta` object. This object provides metadata about the module, including its URL and other properties specific to the environment.\n\nExample:\n\n```javascript\nconsole.log(import.meta.url);\n// Outputs the URL of the current module\n```"
    },
    {
      "link": "#how-do-you-get-property-descriptors-of-an-object",
      "title": "How do you get property descriptors of an object",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, objects",
      "text": "### How do you get property descriptors of an object?\n\nIn JavaScript, you can use `Object.getOwnPropertyDescriptor()` to get the descriptor of a specific property on an object. This descriptor contains details about the property such as whether it's writable, enumerable, or configurable.\n\nExample:\n\n```javascript\nconst person = { name: 'John' };\nconst descriptor = Object.getOwnPropertyDescriptor(person, 'name');\nconsole.log(descriptor);\n// { value: 'John', writable: true, enumerable: true, configurable: true }\n```"
    },
    {
      "link": "#how-do-you-get-the-current-url-with-javascript",
      "title": "How do you get the current url with javascript",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7458367254942502177",
      "level": "basic",
      "theme": "JavaScript, web navigation",
      "text": "### How do you get the current URL with JavaScript?\n\nYou can get the current URL of the page using `window.location.href`.\n\n```javascript\nconsole.log(window.location.href); // Outputs the current URL\n```"
    },
    {
      "link": "#how-do-you-get-the-image-width-and-height-using-js",
      "title": "How do you get the image width and height using JS",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7457292452945268000",
      "level": "basic",
      "theme": "JavaScript, DOM manipulation",
      "text": "### How do you get the image width and height using JS?\n\nYou can get the width and height of an image element using the `width` and `height` properties.\n\nExample:\n\n```javascript\nconst img = document.getElementById('myImage');\nconsole.log(img.width, img.height);\n```"
    },
    {
      "link": "#how-do-you-get-the-prototype-of-an-object",
      "title": "How do you get the prototype of an object",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### How do you get the prototype of an object?\n\nIn JavaScript, you can get the prototype of an object using the `Object.getPrototypeOf()` method. This method returns the prototype (i.e., the internal `[[Prototype]]` property) of the specified object.\n\nExample:\n\n```javascript\nconst person = { name: 'John' };\nconst prototype = Object.getPrototypeOf(person);\nconsole.log(prototype); // Outputs the prototype of the object\n```"
    },
    {
      "link": "#how-do-you-get-the-status-of-a-checkbox",
      "title": "How do you get the status of a checkbox",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, DOM",
      "text": "### How do you get the status of a checkbox?\n\nYou can get the status of a checkbox by accessing its `checked` property. This will return `true` if the checkbox is checked, and `false` otherwise.\n\nExample:\n\n```javascript\nlet checkbox = document.getElementById('myCheckbox');\nconsole.log(checkbox.checked);  // Output: true/false\n```"
    },
    {
      "link": "#how-do-you-get-unique-values-of-an-array",
      "title": "How do you get unique values of an array",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays",
      "text": "### How do you get unique values of an array?\n\nTo get unique values from an array, you can use `Set`, which stores only unique values. You can also use `filter()` and `indexOf()` to remove duplicates.\n\nExample:\n\n```javascript\nlet arr = [1, 2, 2, 3, 4, 4, 5];\nlet uniqueArr = [...new Set(arr)];\nconsole.log(uniqueArr);  // Output: [1, 2, 3, 4, 5]\n```"
    },
    {
      "link": "#how-do-you-group-and-nest-console-output",
      "title": "How do you group and nest console output?",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Console",
      "text": "### How do you group and nest console output?\n\nYou can group and nest console output using `console.group` and `console.groupEnd`:\n\n```javascript\nconsole.group('Outer Group');\nconsole.log('Message in Outer Group');\nconsole.group('Inner Group');\nconsole.log('Message in Inner Group');\nconsole.groupEnd();\nconsole.groupEnd();\n```\n\nOutput:\n```\nOuter Group\n  Message in Outer Group\n  Inner Group\n    Message in Inner Group\n```"
    },
    {
      "link": "#how-do-you-implement-zero-timeout-in-modern-browsers",
      "title": "How do you implement zero timeout in modern browsers",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Performance",
      "text": "### How do you implement zero timeout in modern browsers?\n\nIn modern browsers, you can simulate a zero timeout by using `setTimeout` with a delay of `0`. However, it will be subject to the browser's throttling mechanism, especially in inactive tabs.\n\n```javascript\nsetTimeout(() => console.log('Executed after zero delay'), 0);\n```"
    },
    {
      "link": "#how-do-you-invoke-javascript-code-in-an-iframe-from-parent-page",
      "title": "How do you invoke javascript code in an iframe from parent page",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, iframe",
      "text": "### How do you invoke JavaScript code in an iframe from parent page?\n\nTo invoke JavaScript code inside an iframe from the parent page, you can access the iframe's `contentWindow` property, which provides a reference to the iframe's `window` object.\n\nExample:\n\n```javascript\nconst iframe = document.getElementById('myIframe');\nconst iframeWindow = iframe.contentWindow;\niframeWindow.someFunction(); // Calls a function in the iframe\n```"
    },
    {
      "link": "#how-do-you-list-all-properties-of-an-object",
      "title": "How do you list all properties of an object",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, objects",
      "text": "### How do you list all properties of an object?\n\nYou can list all properties of an object in JavaScript using methods like `Object.keys()`, `Object.getOwnPropertyNames()`, or `for...in` loops.\n\nExample using `Object.keys()`:\n\n```javascript\nconst person = { name: 'John', age: 30 };\nconsole.log(Object.keys(person)); // ['name', 'age']\n```\nExample using `for...in` loop:\n\n```javascript\nconst person = { name: 'John', age: 30 };\nfor (let key in person) {\n  console.log(key); // name, age\n}\n```"
    },
    {
      "link": "#how-do-you-load-css-and-js-files-dynamically",
      "title": "How do you load CSS and JS files dynamically",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, DOM manipulation",
      "text": "### How do you load CSS and JS files dynamically?\n\nYou can dynamically load CSS and JavaScript files by creating `link` and `script` elements and appending them to the document's `head`.\n\nExample for loading a CSS file:\n\n```javascript\nconst link = document.createElement('link');\nlink.rel = 'stylesheet';\nlink.href = 'style.css';\ndocument.head.appendChild(link);\n```\n\nExample for loading a JS file:\n\n```javascript\nconst script = document.createElement('script');\nscript.src = 'script.js';\ndocument.body.appendChild(script);\n```"
    },
    {
      "link": "#how-do-you-loop-through-or-enumerate-javascript-object",
      "title": "How do you loop through or enumerate javascript object",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7455466200588389664",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### How do you loop through or enumerate a JavaScript object?\n\nYou can loop through an object using `for...in` or `Object.keys()` combined with `forEach()`.\n\n```javascript\nconst obj = {name: 'John', age: 30};\nfor (let key in obj) {\n  console.log(key, obj[key]);\n}\n```"
    },
    {
      "link": "#how-do-you-make-an-object-iterable-in-javascript",
      "title": "How do you make an object iterable in JavaScript",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Iterables",
      "text": "### How do you make an object iterable in JavaScript?\n\nTo make an object iterable, you need to implement the `[Symbol.iterator]` method, which returns an iterator object.\n\nExample:\n\n```javascript\nconst iterableObject = {\n  data: [1, 2, 3],\n  [Symbol.iterator]() {\n    let index = 0;\n    let data = this.data;\n    return {\n      next() {\n        return index < data.length\n          ? { value: data[index++], done: false }\n          : { done: true };\n      }\n    };\n  }\n};\n\nfor (let value of iterableObject) {\n  console.log(value);  // Output: 1, 2, 3\n}\n```"
    },
    {
      "link": "#how-do-you-make-asynchronous-http-request",
      "title": "How do you make asynchronous HTTP request",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7457281321589656864",
      "level": "basic",
      "theme": "JavaScript, HTTP requests",
      "text": "### How do you make asynchronous HTTP request?\n\nYou can make an asynchronous HTTP request using `XMLHttpRequest` with `open()` and `send()` methods, and setting the `async` parameter to `true`.\n\nExample:\n\n```javascript\nconst xhr = new XMLHttpRequest();\nxhr.open('GET', 'https://api.example.com', true);\nxhr.send();\nxhr.onload = function() {\n  console.log(xhr.responseText);\n};\n```"
    },
    {
      "link": "#how-do-you-make-first-letter-of-the-string-in-an-uppercase",
      "title": "How do you make first letter of the string in an uppercase",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456035524420062497",
      "level": "basic",
      "theme": "JavaScript, string manipulation",
      "text": "### How do you make the first letter of the string uppercase?\n\nTo make the first letter uppercase, you can use the `charAt()` method and `toUpperCase()` along with `slice()`.\n\n```javascript\nconst str = 'hello';\nconst result = str.charAt(0).toUpperCase() + str.slice(1);\nconsole.log(result); // 'Hello'\n```"
    },
    {
      "link": "#how-do-you-make-synchronous-http-request",
      "title": "How do you make synchronous HTTP request",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7457614380205739296",
      "level": "basic",
      "theme": "JavaScript, HTTP requests",
      "text": "### How do you make synchronous HTTP request?\n\nYou can make a synchronous HTTP request using `XMLHttpRequest` with `open()` and `send()` methods, and setting the `async` parameter to `false`.\n\nExample:\n\n```javascript\nconst xhr = new XMLHttpRequest();\nxhr.open('GET', 'https://api.example.com', false);\nxhr.send();\nconsole.log(xhr.responseText);\n```"
    },
    {
      "link": "#how-do-you-map-the-array-values-without-using-map-method",
      "title": "How do you map the array values without using map method",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays",
      "text": "### How do you map the array values without using map method?\n\nYou can use `forEach()` or a `for` loop to iterate over an array and perform a mapping operation manually.\n\nExample using `forEach()`:\n\n```javascript\nlet arr = [1, 2, 3];\nlet result = [];\narr.forEach(item => result.push(item * 2));\nconsole.log(result);  // Output: [2, 4, 6]\n```"
    },
    {
      "link": "#how-do-you-parse-json-string",
      "title": "How do you parse JSON string",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7457955955557403937",
      "level": "basic",
      "theme": "JavaScript, data formats",
      "text": "### How do you parse a JSON string?\n\nYou can parse a JSON string using the `JSON.parse()` method, which converts the JSON string into a JavaScript object.\n\n```javascript\nconst obj = JSON.parse('{\"name\":\"John\"}');\nconsole.log(obj.name); // John\n```"
    },
    {
      "link": "#how-do-you-perform-form-validation-using-javascript",
      "title": "How do you perform form validation using JavaScript",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, forms",
      "text": "### How do you perform form validation using JavaScript?\n\nForm validation in JavaScript can be performed by adding event listeners to the form elements and checking their values before submitting the form. You can use the `onsubmit` event or validate individual fields using the `oninput` or `onchange` events.\n\nExample:\n\n```javascript\nconst form = document.getElementById('myForm');\nform.onsubmit = function(event) {\n  const email = document.getElementById('email').value;\n  if (!email.includes('@')) {\n    alert('Please enter a valid email address');\n    event.preventDefault();\n  }\n};\n```"
    },
    {
      "link": "#how-do-you-perform-form-validation-without-javascript",
      "title": "How do you perform form validation without JavaScript",
      "url": "",
      "level": "intermediate",
      "theme": "HTML, forms",
      "text": "### How do you perform form validation without JavaScript?\n\nHTML5 provides built-in form validation features that do not require JavaScript. You can use attributes like `required`, `pattern`, `minlength`, `maxlength`, and `type` to validate form fields.\n\nExample:\n\n```html\n<form>\n  <label for=\"email\">Email:</label>\n  <input type=\"email\" id=\"email\" name=\"email\" required>\n  <input type=\"submit\">\n</form>\n```"
    },
    {
      "link": "#how-do-you-perform-language-specific-date-and-time-formatting",
      "title": "How do you perform language specific date and time formatting",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, internationalization",
      "text": "### How do you perform language-specific date and time formatting?\n\nIn JavaScript, you can use the `Intl.DateTimeFormat` object to format dates and times according to a specific locale. It allows you to customize the date and time formatting styles (e.g., short, long, etc.) and even customize how individual date parts (like day, month, year) are displayed.\n\nExample:\n\n```javascript\nconst date = new Date();\nconst formatter = new Intl.DateTimeFormat('en-US', { year: 'numeric', month: 'long', day: 'numeric' });\nconsole.log(formatter.format(date)); // 'December 21, 2024'\n```"
    },
    {
      "link": "#how-do-you-prevent-an-object-to-extend",
      "title": "How do you prevent an object to extend",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### How do you prevent an object to extend?\n\nYou can prevent an object from being extended (i.e., from adding new properties) using the `Object.preventExtensions()` method. This method makes the object non-extensible.\n\nExample:\n\n```javascript\nconst obj = { name: 'John' };\nObject.preventExtensions(obj);\nobj.age = 30; // Won't be added\nconsole.log(obj); // { name: 'John' }\n```"
    },
    {
      "link": "#how-do-you-prevent-promises-swallowing-errors",
      "title": "How do you prevent promises swallowing errors",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Promises",
      "text": "### How do you prevent promises from swallowing errors?\n\nTo prevent promises from swallowing errors, ensure that you handle rejections using `.catch()` or use `try-catch` with `async-await` syntax. Additionally, always return or throw errors explicitly.\n\nExample:\n\n```javascript\nPromise.resolve()\n  .then(() => { throw new Error('Error occurred'); })\n  .catch(error => console.error('Caught error:', error));\n\nasync function asyncFunction() {\n  try {\n    await Promise.reject('Error occurred');\n  } catch (error) {\n    console.error('Caught error:', error);\n  }\n}\nasyncFunction();\n```"
    },
    {
      "link": "#how-do-you-print-numbers-with-commas-as-thousand-separators",
      "title": "How do you print numbers with commas as thousand separators",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, number formatting",
      "text": "### How do you print numbers with commas as thousand separators?\n\nYou can use the `toLocaleString()` method to format numbers with commas as thousand separators.\n\nExample:\n\n```javascript\nconst number = 1234567.89;\nconsole.log(number.toLocaleString()); // '1,234,567.89'\n```"
    },
    {
      "link": "#how-do-you-print-the-contents-of-web-page",
      "title": "How do you print the contents of web page",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, printing",
      "text": "### How do you print the contents of web page?\n\nYou can use the `window.print()` method to print the contents of a web page.\n\nExample:\n\n```javascript\nwindow.print();\n```"
    },
    {
      "link": "#how-do-you-redirect-new-page-in-javascript",
      "title": "How do you redirect new page in javascript",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7453541079804169504",
      "level": "basic",
      "theme": "JavaScript, web navigation",
      "text": "### How do you redirect to a new page in JavaScript?\n\nTo redirect to a new page in JavaScript, you can use `window.location.href` or `window.location.assign()`. Both methods will navigate the browser to the specified URL.\n\n```javascript\nwindow.location.href = 'https://example.com';\n```"
    },
    {
      "link": "#how-do-you-remove-falsy-values-from-an-array",
      "title": "How do you remove falsy values from an array",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays",
      "text": "### How do you remove falsy values from an array?\n\nYou can use the `filter()` method to remove falsy values (e.g., `false`, `null`, `undefined`, `0`, `NaN`, `\"\"`) from an array.\n\nExample:\n\n```javascript\nlet arr = [0, 1, false, 2, '', 3, null];\nlet filteredArr = arr.filter(Boolean);\nconsole.log(filteredArr);  // Output: [1, 2, 3]\n```"
    },
    {
      "link": "#how-do-you-return-all-matching-strings-against-a-regular-expression",
      "title": "How do you return all matching strings against a regular expression",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Regular Expressions",
      "text": "### How do you return all matching strings against a regular expression?\n\nYou can use the `match()` method with a regular expression to return all matching substrings in a string. The `g` flag in the regular expression allows the method to match all occurrences, not just the first one.\n\nExample:\n\n```javascript\nlet str = 'abc123 def456 ghi789';\nlet matches = str.match(/\\d+/g);\nconsole.log(matches);  // Output: ['123', '456', '789']\n```\n\nIn this example, `\\d+` is a regular expression that matches one or more digits, and the `g` flag ensures that all matches are returned in an array."
    },
    {
      "link": "#how-do-you-reverse-an-array-without-modifying-original-array",
      "title": "How do you reverse an array without modifying original array?",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays",
      "text": "### How do you reverse an array without modifying original array?\n\nUse the `slice` method to create a shallow copy and then reverse the copy:\n\n```javascript\nconst originalArray = [1, 2, 3];\nconst reversedArray = originalArray.slice().reverse();\nconsole.log(originalArray); // [1, 2, 3]\nconsole.log(reversedArray); // [3, 2, 1]\n```"
    },
    {
      "link": "#how-do-you-reversing-an-array",
      "title": "How do you reverse an array",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, arrays",
      "text": "### How do you reverse an array?\n\nYou can reverse the order of elements in an array using the `reverse()` method in JavaScript. This method modifies the original array in place.\n\nExample:\n\n```javascript\nconst arr = [1, 2, 3];\narr.reverse();\nconsole.log(arr); // [3, 2, 1]\n```"
    },
    {
      "link": "#how-do-you-round-numbers-to-certain-decimals",
      "title": "How do you round numbers to certain decimals",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Numbers",
      "text": "### How do you round numbers to certain decimals?\n\nYou can use `toFixed()` or `Math.round()` to round numbers to a specified number of decimals.\n\nExample:\n\n```javascript\nlet num = 5.6789;\nlet rounded = num.toFixed(2);\nconsole.log(rounded);  // Output: '5.68'\n```"
    },
    {
      "link": "#how-do-you-search-a-string-for-a-pattern",
      "title": "How do you search a string for a pattern",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456824435211816224",
      "level": "basic",
      "theme": "JavaScript, regular expressions",
      "text": "### How do you search a string for a pattern?\n\nYou can use the `test()` method of the `RegExp` object to search for a pattern in a string.\n\nExample:\n\n```javascript\nconst regex = /\\d+/;\nconsole.log(regex.test('abc123')); // true\n```"
    },
    {
      "link": "#how-do-you-set-prototype-of-one-object-to-another",
      "title": "How do you set prototype of one object to another",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### How do you set prototype of one object to another?\n\nYou can set the prototype of one object to another using the `Object.setPrototypeOf()` method. This method allows you to change the prototype chain of an object.\n\nExample:\n\n```javascript\nconst animal = { speak: function() { console.log('Animal speaks'); } };\nconst dog = {};\nObject.setPrototypeOf(dog, animal);\ndog.speak(); // Animal speaks\n```"
    },
    {
      "link": "#how-do-you-sort-elements-in-an-array",
      "title": "How do you sort elements in an array",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, arrays",
      "text": "### How do you sort elements in an array?\n\nYou can sort elements in an array using the `sort()` method in JavaScript. The `sort()` method sorts the array in place, and you can pass a compare function to customize the sorting order.\n\nExample:\n\n```javascript\nconst arr = [3, 1, 2];\narr.sort();\nconsole.log(arr); // ['1', '2', '3']\n\narr.sort((a, b) => a - b);\nconsole.log(arr); // [1, 2, 3]\n```"
    },
    {
      "link": "#how-do-you-submit-a-form-using-javascript",
      "title": "How do you submit a form using JavaScript",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7454702289975119136",
      "level": "basic",
      "theme": "JavaScript, forms",
      "text": "### How do you submit a form using JavaScript?\n\nYou can submit a form in JavaScript using the `submit()` method on the form element, like so:\n\n```javascript\ndocument.getElementById('myForm').submit();\n```"
    },
    {
      "link": "#how-do-you-swap-variables-in-destructuring-assignment",
      "title": "How do you swap variables in destructuring assignment",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Destructuring",
      "text": "### How do you swap variables in destructuring assignment?\n\nYou can swap the values of two variables using destructuring assignment. This eliminates the need for a temporary variable.\n\nExample:\n\n```javascript\nlet a = 1, b = 2;\n[a, b] = [b, a];\nconsole.log(a, b);  // Output: 2 1\n```"
    },
    {
      "link": "#how-do-you-test-for-an-empty-object",
      "title": "How do you test for an empty object",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7455470039198682401",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### How do you test for an empty object?\n\nTo check if an object is empty, you can use `Object.keys()` and check if the length is zero.\n\n```javascript\nconst obj = {};\nconsole.log(Object.keys(obj).length === 0); // true\n```"
    },
    {
      "link": "#how-do-you-trim-a-string-at-the-beginning-or-ending",
      "title": "How do you trim a string at the beginning or ending",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, String Manipulation",
      "text": "### How do you trim a string at the beginning or ending?\n\nYou can use the `trimStart()` and `trimEnd()` methods to remove whitespace from the beginning or the end of a string, respectively. Alternatively, `trim()` removes whitespace from both ends.\n\nExample:\n\n```javascript\nlet str = '   Hello World!   ';\nconsole.log(str.trimStart());  // Output: 'Hello World!   '\nconsole.log(str.trimEnd());    // Output: '   Hello World!'\n```"
    },
    {
      "link": "#how-do-you-trim-a-string-in-javascript",
      "title": "How do you trim a string in javascript",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7455853408113675552",
      "level": "basic",
      "theme": "JavaScript, string manipulation",
      "text": "### How do you trim a string in JavaScript?\n\nTo remove whitespace from both ends of a string, use the `trim()` method.\n\n```javascript\nconst str = '  Hello World  ';\nconsole.log(str.trim()); // 'Hello World'\n```"
    },
    {
      "link": "#how-do-you-use-javascript-libraries-in-typescript-file",
      "title": "How do you use JavaScript libraries in TypeScript file",
      "url": "",
      "level": "intermediate",
      "theme": "TypeScript, JavaScript",
      "text": "### How do you use JavaScript libraries in TypeScript file?\n\nIn TypeScript, you can use JavaScript libraries by either importing them directly or by installing type definitions (if available). To import a JavaScript library, you can use the `import` keyword or the `require` function.\n\nExample using `import`:\n\n```typescript\nimport * as library from 'library';\n```"
    },
    {
      "link": "#how-do-you-validate-an-email-in-javascript",
      "title": "How do you validate an email in javascript",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456043510161067296",
      "level": "basic",
      "theme": "JavaScript, validation",
      "text": "### How do you validate an email in JavaScript?\n\nTo validate an email in JavaScript, you can use a regular expression. A common pattern for basic email validation looks like this:\n\n```javascript\nconst email = 'test@example.com';\nconst regex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$/;\nconsole.log(regex.test(email)); // true\n```"
    },
    {
      "link": "#how-do-you-verify-that-an-argument-is-a-number-or-not",
      "title": "How do you verify that an argument is a Number or not",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Data Types",
      "text": "### How do you verify that an argument is a Number or not?\n\nYou can verify if a value is a number by using `typeof` operator or `Number.isNaN()` method.\n\nExample using `typeof`:\n\n```javascript\nlet value = 25;\nconsole.log(typeof value === 'number');  // Output: true\n```\nExample using `Number.isNaN()`:\n\n```javascript\nlet value = NaN;\nconsole.log(Number.isNaN(value));  // Output: true\n```"
    },
    {
      "link": "#how-do-you-write-multi-line-strings-in-template-literals",
      "title": "How do you write multi-line strings in template literals",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Strings",
      "text": "### How do you write multi-line strings in template literals?\n\nYou can create multi-line strings in template literals by simply including line breaks within the backticks. This is much easier than using traditional string concatenation.\n\nExample:\n\n```javascript\nlet multilineString = `This is a\nmulti-line\nstring.`;\nconsole.log(multilineString);\n// Output: \n// This is a\n// multi-line\n// string.\n```"
    },
    {
      "link": "#how-does-synchronous-iteration-works",
      "title": "How does synchronous iteration works",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, iteration",
      "text": "### How does synchronous iteration work?\n\nSynchronous iteration means that each iteration of the loop or iterator occurs one after the other. The code execution waits for the current iteration to complete before moving on to the next one. This is the default behavior in most loops like `for`, `while`, and `forEach`.\n\nExample:\n\n```javascript\nconst arr = [1, 2, 3];\narr.forEach(item => console.log(item)); // Output: 1, 2, 3\n```"
    },
    {
      "link": "#how-to-cancel-a-fetch-request",
      "title": "How to cancel a fetch request",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Fetch API",
      "text": "### How to cancel a fetch request?\n\nYou can cancel a fetch request using an `AbortController`. The `AbortController` allows you to abort one or more fetch requests.\n\nExample:\n\n```javascript\nlet controller = new AbortController();\nlet signal = controller.signal;\n\nfetch('https://api.example.com/data', { signal: signal })\n  .then(response => response.json())\n  .then(data => console.log(data))\n  .catch(err => console.log('Fetch aborted', err));\n\n// To cancel the request\ncontroller.abort();\n```"
    },
    {
      "link": "#how-to-convert-string-to-title-case-with-javascript",
      "title": "How to convert string to title case with javascript",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7457578972889615648",
      "level": "basic",
      "theme": "JavaScript, string manipulation",
      "text": "### How to convert string to title case with JavaScript?\n\nYou can convert a string to title case by splitting the string into words, capitalizing the first letter of each word, and then joining them back together.\n\nExample:\n\n```javascript\nfunction toTitleCase(str) {\n  return str.replace(/\\b(\\w)/g, char => char.toUpperCase());\n}\nconsole.log(toTitleCase('hello world')); // 'Hello World'\n```"
    },
    {
      "link": "#how-to-detect-if-a-function-is-called-as-constructor",
      "title": "How to detect if a function is called as a constructor",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Functions",
      "text": "### How to detect if a function is called as a constructor?\n\nTo detect if a function is called as a constructor, check the value of `this`. In a constructor call, `this` refers to the newly created object.\n\nExample:\n\n```javascript\nfunction MyFunction() {\n  if (!(this instanceof MyFunction)) {\n    throw new Error('Must be called with new');\n  }\n  console.log('Called as constructor');\n}\n\nnew MyFunction();  // Works\nMyFunction();  // Throws error\n```"
    },
    {
      "link": "#how-to-detect-system-dark-mode-in-javascript",
      "title": "How to detect system dark mode in JavaScript?",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Web APIs",
      "text": "### How to detect system dark mode in JavaScript?\n\nUse the `matchMedia` method with the `(prefers-color-scheme)` media query.\n\nExample:\n```javascript\nconst isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches;\n\nif (isDarkMode) {\n  console.log('Dark mode is enabled');\n} else {\n  console.log('Light mode is enabled');\n}\n```\n\n#### Listen for Changes:\n```javascript\nconst mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');\n\nmediaQuery.addEventListener('change', event => {\n  if (event.matches) {\n    console.log('Dark mode activated');\n  } else {\n    console.log('Light mode activated');\n  }\n});\n```"
    },
    {
      "link": "#how-to-find-the-number-of-parameters-expected-by-a-function",
      "title": "How to find the number of parameters expected by a function?",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Functions",
      "text": "### How to find the number of parameters expected by a function?\n\nUse the `length` property of a function.\n\nExample:\n```javascript\nfunction example(a, b, c) {}\n\nconsole.log(example.length); // 3\n```\n\nNote: Default parameters and rest parameters are not counted in the `length` property."
    },
    {
      "link": "#how-to-get-the-value-from-get-parameters",
      "title": "How to get the value from get parameters",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, URL manipulation",
      "text": "### How to get the value from GET parameters?\n\nYou can get the value of a GET parameter in the URL using `URLSearchParams`.\n\nExample:\n\n```javascript\nconst urlParams = new URLSearchParams(window.location.search);\nconst value = urlParams.get('param');\nconsole.log(value); // Logs the value of 'param' from the URL\n```"
    },
    {
      "link": "#how-to-invoke-an-iife-without-any-extra-brackets",
      "title": "How to invoke an IIFE without any extra brackets?",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Functions",
      "text": "### How to invoke an IIFE without any extra brackets?\n\nUse an **Unary Operator** like `!` or `+` before the function to execute it immediately:\n\nExample:\n\n```javascript\n!function() {\n  console.log('IIFE invoked!');\n}();\n\n+function() {\n  console.log('Another IIFE invoked!');\n}();\n```"
    },
    {
      "link": "#how-to-remove-all-line-breaks-from-a-string",
      "title": "How to remove all line breaks from a string",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Strings",
      "text": "### How to remove all line breaks from a string?\n\nYou can remove line breaks using the `replace()` method with a regular expression that targets line breaks (`\n` or `\r`).\n\nExample:\n\n```javascript\nlet str = 'Hello\nWorld\n!';\nlet cleanedStr = str.replace(/[\r\n]+/g, ' ');\nconsole.log(cleanedStr);  // Output: 'Hello World !'\n```"
    },
    {
      "link": "#how-to-set-the-cursor-to-wait",
      "title": "How to set the cursor to wait",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, UI manipulation",
      "text": "### How to set the cursor to wait?\n\nYou can change the cursor to a wait (or busy) cursor using CSS by setting the `cursor` property to `wait`.\n\nExample:\n\n```javascript\ndocument.body.style.cursor = 'wait';  // Changes cursor to wait\n// After a task is done\ndocument.body.style.cursor = 'default';  // Changes cursor back to default\n```"
    },
    {
      "link": "#how-to-use-await-outside-of-async-function-prior-to-es2022",
      "title": "How to use await outside of async function prior to ES2022?",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Asynchronous Programming",
      "text": "### How to use await outside of async function prior to ES2022?\n\nBefore ES2022, `await` could only be used inside `async` functions. To achieve similar behavior outside of `async` functions, you could use:\n\n1. **Immediately Invoked Async Function Expression (IIAFE):**\n   ```javascript\n   (async () => {\n     const result = await fetch('https://api.example.com');\n     console.log(result);\n   })();\n   ```\n\n2. **Promise Handling with `.then()`:**\n   ```javascript\n   fetch('https://api.example.com')\n     .then(response => response.json())\n     .then(data => console.log(data));\n   ```\n\nWith ES2022, `await` can be used in top-level code in modules."
    },
    {
      "link": "#how-to-verify-if-a-variable-is-an-array",
      "title": "How to verify if a variable is an array?",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Data Types",
      "text": "### How to verify if a variable is an array?\n\nYou can verify if a variable is an array using `Array.isArray()` method. It returns `true` if the value is an array, otherwise `false`.\n\nExample:\n\n```javascript\nconst arr = [1, 2, 3];\nconsole.log(Array.isArray(arr)); // true\n\nconst obj = { key: 'value' };\nconsole.log(Array.isArray(obj)); // false\n```"
    },
    {
      "link": "#is-enums-feature-available-in-javascript",
      "title": "Is enums feature available in JavaScript",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, features",
      "text": "### Is enums feature available in JavaScript?\n\nJavaScript does not have built-in support for `enum` types like some other programming languages (e.g., TypeScript, C++). However, you can simulate `enums` in JavaScript using objects or `const` variables.\n\nExample using an object:\n\n```javascript\nconst Colors = {\n  RED: 'red',\n  GREEN: 'green',\n  BLUE: 'blue'\n};\nconsole.log(Colors.RED); // 'red'\n```\nAlternatively, TypeScript provides a native `enum` feature."
    },
    {
      "link": "#is-it-possible-to-add-css-to-console-messages",
      "title": "Is it possible to add CSS to console messages",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Console",
      "text": "### Is it possible to add CSS to console messages?\n\nYes, you can add CSS to console messages using `%c` placeholder in the `console.log()` method. This allows you to style the output text in the console.\n\nExample:\n\n```javascript\nconsole.log('%cHello, world!', 'color: red; font-size: 20px;');\n```"
    },
    {
      "link": "#is-it-possible-to-debug-html-elements-in-console",
      "title": "Is it possible to debug HTML elements in console",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Debugging",
      "text": "### Is it possible to debug HTML elements in console?\n\nYes, you can debug HTML elements directly in the console by using `console.dir()` to inspect their properties and methods. Additionally, you can use `console.log()` to output HTML elements or other objects for debugging purposes.\n\nExample:\n\n```javascript\nlet element = document.querySelector('div');\nconsole.dir(element);\n```"
    },
    {
      "link": "#is-it-recommended-to-use-eval",
      "title": "Is it recommended to use eval",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456751494948293920",
      "level": "basic",
      "theme": "JavaScript, security",
      "text": "### Is it recommended to use eval?\n\nIt is generally not recommended to use `eval()` in JavaScript due to security risks and performance concerns. `eval()` executes code passed as a string, which can be exploited by attackers."
    },
    {
      "link": "#is-javascript-a-case-sensitive-language",
      "title": "Is JavaScript a case-sensitive language",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7454353440626445601",
      "level": "basic",
      "theme": "JavaScript, language concepts",
      "text": "### Is JavaScript a case-sensitive language?\n\nYes, JavaScript is a case-sensitive language. For example, `variable` and `Variable` would be considered two different identifiers."
    },
    {
      "link": "#is-javascript-a-compiled-or-interpreted-language",
      "title": "Is JavaScript a compiled or interpreted language",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7454351953959652640",
      "level": "basic",
      "theme": "JavaScript, language concepts",
      "text": "### Is JavaScript a compiled or interpreted language?\n\nJavaScript is an interpreted language. It is executed line by line by the JavaScript engine in the browser, rather than being compiled beforehand like C or Java."
    },
    {
      "link": "#is-javascript-faster-than-server-side-script",
      "title": "Is JavaScript faster than server side script",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Performance",
      "text": "### Is JavaScript faster than server-side script?\n\nJavaScript runs in the browser and is typically faster for client-side operations, especially for DOM manipulation and interactions. However, server-side scripts (e.g., PHP, Node.js) can be faster for processing large datasets or performing complex operations due to server-side resources."
    },
    {
      "link": "#is-nodejs-completely-single-threaded",
      "title": "Is Node.js completely single threaded",
      "url": "",
      "level": "intermediate",
      "theme": "Node.js, JavaScript",
      "text": "### Is Node.js completely single threaded?\n\nNo, Node.js is not completely single-threaded. While the event loop and most of the JavaScript code execution are single-threaded, Node.js uses multiple threads for I/O operations and certain asynchronous tasks. For example, it uses the libuv library to handle file system operations and network requests in parallel.\n\nHowever, JavaScript code execution in Node.js runs on a single thread, making it lightweight and efficient for handling I/O-bound tasks."
    },
    {
      "link": "#is-postmessage-secure",
      "title": "Is PostMessage secure",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Security",
      "text": "### Is PostMessage secure?\n\nThe `postMessage` API is secure if used correctly. However, it can be vulnerable if not properly handled, as it can expose data to unintended origins. It is crucial to validate the `targetOrigin` and avoid using wildcards to ensure secure messaging.\n\nExample:\n\n```javascript\nwindow.postMessage('message', 'https://example.com');\n```"
    },
    {
      "link": "#is-postmessages-synchronous",
      "title": "Is postMessages synchronous",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Web APIs",
      "text": "### Is postMessages synchronous?\n\nThe `postMessage` API is asynchronous. The message is posted to the message queue and handled later, allowing the rest of the script to continue executing without blocking.\n\nExample:\n\n```javascript\nwindow.postMessage('message', 'https://example.com');\nconsole.log('Message sent');  // Output: Message sent\n```"
    },
    {
      "link": "#is-that-possible-to-use-expressions-in-switch-cases",
      "title": "Is that possible to use expressions in switch cases?",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Control Flow",
      "text": "### Is that possible to use expressions in switch cases?\n\nYes, you can use expressions in `case` statements. The expression is evaluated and compared with the `switch` value.\n\nExample:\n\n```javascript\nconst value = 10;\nswitch (value) {\n  case 5 + 5:\n    console.log('Matched 10');\n    break;\n  default:\n    console.log('No match');\n}\n```"
    },
    {
      "link": "#is-the----notation-represents-a-special-operator",
      "title": "Is the !-- notation represents a special operator",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456013855827791137",
      "level": "basic",
      "theme": "JavaScript, operators",
      "text": "### Is the `!--` notation represents a special operator?\n\nThe `!--` notation is not a special operator in JavaScript. It is often a typo or part of HTML comments (`<!-- -->`). In JavaScript, `!` is the logical NOT operator, and `--` is the decrement operator."
    },
    {
      "link": "#is-there-any-relation-between-java-and-javascript",
      "title": "Is there any relation between Java and JavaScript",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7454554999335537952",
      "level": "basic",
      "theme": "JavaScript, general knowledge",
      "text": "### Is there any relation between Java and JavaScript?\n\nDespite the similar names, Java and JavaScript are not directly related. Java is a class-based, object-oriented programming language, while JavaScript is a lightweight, interpreted scripting language primarily used for web development."
    },
    {
      "link": "#list-down-some-of-the-features-of-es6",
      "title": "List down some of the features of ES6",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, ES6",
      "text": "### List down some of the features of ES6\n\nES6 (ECMAScript 2015) introduced several new features to JavaScript, including:\n- **Let and const**: Block-scoped variables.\n- **Arrow functions**: Shorter function syntax.\n- **Template literals**: String interpolation.\n- **Destructuring assignment**: Easier extraction of values from arrays or objects.\n- **Promises**: Handling asynchronous operations more efficiently.\n\nExample:\n\n```javascript\nconst [first, second] = [1, 2];\nconsole.log(first, second);  // Output: 1 2\n```"
    },
    {
      "link": "#list-down-the-collection-of-methods-available-on-weakmap",
      "title": "List down the collection of methods available on WeakMap",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, collections",
      "text": "### List down the collection of methods available on WeakMap\n\nThe `WeakMap` object supports the following methods:\n\n- `set(key, value)` – Adds a key-value pair.\n- `get(key)` – Retrieves the value associated with the key.\n- `has(key)` – Checks if a key exists in the `WeakMap`.\n- `delete(key)` – Removes a key-value pair.\n\nExample:\n\n```javascript\nconst obj = { name: 'John' };\nconst weakmap = new WeakMap();\nweakmap.set(obj, 'value');\nconsole.log(weakmap.get(obj)); // 'value'\n```"
    },
    {
      "link": "#list-down-the-collection-of-methods-available-on-weakset",
      "title": "List down the collection of methods available on WeakSet",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7458291433980579105",
      "level": "basic",
      "theme": "JavaScript, collections",
      "text": "### List down the collection of methods available on WeakSet\n\nThe `WeakSet` object supports the following methods:\n\n- `add(value)` – Adds a value to the set.\n- `delete(value)` – Removes a value from the set.\n- `has(value)` – Checks if a value is in the set.\n\nExample:\n\n```javascript\nconst obj = { name: 'John' };\nconst weakset = new WeakSet([obj]);\nweakset.add(obj);\nconsole.log(weakset.has(obj)); // true\nweakset.delete(obj);\nconsole.log(weakset.has(obj)); // false\n```"
    },
    {
      "link": "#merge-two-sorted-arrays",
      "title": "Merge Two Sorted Arrays",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Merge Two Sorted Arrays\n\nTo merge two sorted arrays into one sorted array, use two pointers to compare the elements from both arrays.\n\n#### Algorithm:\n1. Initialize two pointers, one for each array.\n2. Compare the elements at the current pointers and add the smaller element to the result array.\n3. Move the pointer of the array from which the element was taken.\n4. If one array is exhausted, add the remaining elements of the other array to the result.\n5. Return the merged sorted array.\n\n#### Example:\n```javascript\nfunction mergeSortedArrays(arr1, arr2) {\n    let result = [];\n    let i = 0, j = 0;\n\n    while (i < arr1.length && j < arr2.length) {\n        if (arr1[i] < arr2[j]) {\n            result.push(arr1[i]);\n            i++;\n        } else {\n            result.push(arr2[j]);\n            j++;\n        }\n    }\n\n    return result.concat(arr1.slice(i), arr2.slice(j));\n}\n\n// Example usage\nconsole.log(mergeSortedArrays([1, 3, 5], [2, 4, 6])); // Output: [1, 2, 3, 4, 5, 6]\n```\n\nThis method has a time complexity of O(n + m), where n and m are the lengths of the two arrays."
    },
    {
      "link": "#merge-two-sorted-linked-lists",
      "title": "Merge Two Sorted Linked Lists",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Linked Lists, Algorithm",
      "text": "### Merge Two Sorted Linked Lists\n\nTo merge two sorted linked lists into one sorted linked list, use a two-pointer approach to traverse both lists and merge them in sorted order.\n\n#### Algorithm:\n1. Initialize two pointers, one for each list.\n2. Compare the elements of both lists and append the smaller element to the merged list.\n3. Once one list is exhausted, append the remaining elements from the other list.\n4. Return the merged sorted list.\n\n#### Example:\n```javascript\nfunction mergeLists(l1, l2) {\n    let dummy = new ListNode(0);\n    let current = dummy;\n    while (l1 && l2) {\n        if (l1.val < l2.val) {\n            current.next = l1;\n            l1 = l1.next;\n        } else {\n            current.next = l2;\n            l2 = l2.next;\n        }\n        current = current.next;\n    }\n    current.next = l1 || l2;\n    return dummy.next;\n}\n\n// Example usage\n// Assuming ListNode is defined with val and next properties\n```\n\nThis method has a time complexity of O(n + m), where n and m are the lengths of the two linked lists."
    },
    {
      "link": "#remove-duplicate-characters-from-a-string",
      "title": "Remove Duplicate Characters from a String",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Strings, Algorithm",
      "text": "### Remove Duplicate Characters from a String\n\nTo remove duplicate characters from a string, you can use a set to store unique characters.\n\n#### Algorithm:\n1. Initialize an empty set to store unique characters.\n2. Iterate through the string and add each character to the set.\n3. Join the characters from the set into a new string and return it.\n\n#### Example:\n```javascript\nfunction removeDuplicates(str) {\n    return [...new Set(str)].join('');\n}\n\n// Example usage\nconsole.log(removeDuplicates(\"programming\")); // Output: \"progamin\"\nconsole.log(removeDuplicates(\"hello\")); // Output: \"helo\"\n```\n\nThis method has a time complexity of O(n), where n is the length of the string."
    },
    {
      "link": "#remove-duplicates-from-an-array",
      "title": "Remove Duplicates from an Array",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Remove Duplicates from an Array\n\nTo remove duplicates from an array, you can use a Set, which automatically stores unique values.\n\n#### Algorithm:\n1. Convert the array into a Set, which will automatically remove any duplicate values.\n2. Convert the Set back into an array.\n3. Return the new array with unique elements.\n\n#### Example:\n```javascript\nfunction removeDuplicates(arr) {\n    return [...new Set(arr)];\n}\n\n// Example usage\nconsole.log(removeDuplicates([1, 2, 2, 3, 4, 4, 5])); // Output: [1, 2, 3, 4, 5]\nconsole.log(removeDuplicates([\"apple\", \"banana\", \"apple\", \"orange\"])); // Output: [\"apple\", \"banana\", \"orange\"]\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#remove-element-from-an-array",
      "title": "Remove an Element from an Array",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Remove an Element from an Array\n\nTo remove an element from an array, you can use the `filter` method or manually iterate through the array.\n\n#### Algorithm:\n1. Use the `filter` method to create a new array without the specified element.\n2. Alternatively, iterate through the array and remove the element manually.\n3. Return the modified array.\n\n#### Example:\n```javascript\nfunction removeElement(arr, elem) {\n    return arr.filter(item => item !== elem);\n}\n\n// Example usage\nconsole.log(removeElement([1, 2, 3, 4, 5], 3)); // Output: [1, 2, 4, 5]\nconsole.log(removeElement([\"apple\", \"banana\", \"orange\"], \"banana\")); // Output: [\"apple\", \"orange\"]\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#reverse-a-string",
      "title": "Reverse a String",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Strings, Algorithm",
      "text": "### Reverse a String\n\nTo reverse a string, you can split the string into an array of characters, reverse the array, and then join the characters back into a string.\n\n#### Algorithm:\n1. Convert the string into an array of characters.\n2. Use the `reverse()` method to reverse the array.\n3. Join the array back into a string using the `join()` method.\n4. Return the reversed string.\n\n#### Example:\n```javascript\nfunction reverseString(str) {\n    return str.split('').reverse().join('');\n}\n\n// Example usage\nconsole.log(reverseString(\"hello\")); // Output: \"olleh\"\nconsole.log(reverseString(\"JavaScript\")); // Output: \"tpircSavaJ\"\n```\n\nThis method has a time complexity of O(n), where n is the length of the string."
    },
    {
      "link": "#reverse-an-array",
      "title": "Reverse an Array",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Reverse an Array\n\nTo reverse an array, you can use the `reverse` method or iterate through the array manually.\n\n#### Algorithm:\n1. Initialize two pointers: one at the beginning and one at the end of the array.\n2. Swap the elements at the two pointers.\n3. Move the pointers toward the center until they meet.\n4. Return the reversed array.\n\n#### Example:\n```javascript\nfunction reverseArray(arr) {\n    let left = 0, right = arr.length - 1;\n\n    while (left < right) {\n        [arr[left], arr[right]] = [arr[right], arr[left]];\n        left++;\n        right--;\n    }\n    return arr;\n}\n\n// Example usage\nconsole.log(reverseArray([1, 2, 3, 4])); // Output: [4, 3, 2, 1]\nconsole.log(reverseArray([\"a\", \"b\", \"c\"])); // Output: [\"c\", \"b\", \"a\"]\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#reverse-an-array-in-place",
      "title": "Reverse an Array In-Place",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Reverse an Array In-Place\n\nTo reverse an array in-place, use two pointers, one at the start and one at the end of the array. Swap elements at these pointers and move towards the center.\n\n#### Algorithm:\n1. Initialize two pointers: one at the start and one at the end of the array.\n2. Swap the elements at these pointers.\n3. Move the pointers towards the center.\n4. Repeat until the pointers cross.\n\n#### Example:\n```javascript\nfunction reverseArray(arr) {\n    let start = 0;\n    let end = arr.length - 1;\n    while (start < end) {\n        [arr[start], arr[end]] = [arr[end], arr[start]];\n        start++;\n        end--;\n    }\n    return arr;\n}\n\n// Example usage\nconsole.log(reverseArray([1, 2, 3, 4, 5])); // Output: [5, 4, 3, 2, 1]\nconsole.log(reverseArray([10, 20, 30])); // Output: [30, 20, 10]\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#rotate-an-array",
      "title": "Rotate an Array",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Rotate an Array\n\nTo rotate an array, move the elements from one end to the other by a specified number of positions.\n\n#### Algorithm:\n1. Calculate the effective number of rotations by taking the modulus of the length of the array with the rotation count.\n2. Slice the array into two parts: the part to be moved and the remaining part.\n3. Concatenate the two parts in the rotated order.\n4. Return the rotated array.\n\n#### Example:\n```javascript\nfunction rotateArray(arr, k) {\n    const rotations = k % arr.length;\n    return [...arr.slice(rotations), ...arr.slice(0, rotations)];\n}\n\n// Example usage\nconsole.log(rotateArray([1, 2, 3, 4, 5], 2)); // Output: [3, 4, 5, 1, 2]\nconsole.log(rotateArray([1, 2, 3], 4)); // Output: [2, 3, 1]\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#sort-an-array-in-ascending-order",
      "title": "Sort an Array in Ascending Order",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Sort an Array in Ascending Order\n\nTo sort an array in ascending order, you can use the `sort` method in JavaScript.\n\n#### Algorithm:\n1. Use the `sort` method with a comparison function to sort the array in ascending order.\n2. The comparison function should return a negative, zero, or positive value based on the comparison of two elements.\n3. Return the sorted array.\n\n#### Example:\n```javascript\nfunction sortArray(arr) {\n    return arr.sort((a, b) => a - b);\n}\n\n// Example usage\nconsole.log(sortArray([5, 2, 9, 1, 5, 6])); // Output: [1, 2, 5, 5, 6, 9]\nconsole.log(sortArray([3, 1, 4, 2])); // Output: [1, 2, 3, 4]\n```\n\nThis method has a time complexity of O(n log n), where n is the length of the array."
    },
    {
      "link": "#sum-of-all-even-numbers-in-an-array",
      "title": "Sum of All Even Numbers in an Array",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Sum of All Even Numbers in an Array\n\nTo find the sum of all even numbers in an array, iterate through the array and add the even numbers to a running total.\n\n#### Algorithm:\n1. Initialize a variable to store the sum of even numbers.\n2. Iterate through the array and check if each number is even (i.e., divisible by 2).\n3. If the number is even, add it to the sum.\n4. Return the final sum.\n\n#### Example:\n```javascript\nfunction sumEvenNumbers(arr) {\n    let sum = 0;\n    for (const num of arr) {\n        if (num % 2 === 0) {\n            sum += num;\n        }\n    }\n    return sum;\n}\n\n// Example usage\nconsole.log(sumEvenNumbers([1, 2, 3, 4, 5, 6])); // Output: 12\nconsole.log(sumEvenNumbers([10, 15, 20, 25])); // Output: 30\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#sum-of-all-odd-numbers-in-an-array",
      "title": "Sum of All Odd Numbers in an Array",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays, Algorithm",
      "text": "### Sum of All Odd Numbers in an Array\n\nTo calculate the sum of all odd numbers in an array, iterate through the array and add up the odd numbers.\n\n#### Algorithm:\n1. Initialize a variable to store the sum.\n2. Iterate through the array, checking if each number is odd.\n3. If the number is odd, add it to the sum.\n4. Return the sum.\n\n#### Example:\n```javascript\nfunction sumOfOdds(arr) {\n    return arr.filter(num => num % 2 !== 0).reduce((sum, num) => sum + num, 0);\n}\n\n// Example usage\nconsole.log(sumOfOdds([1, 2, 3, 4, 5])); // Output: 9\nconsole.log(sumOfOdds([6, 7, 8, 9])); // Output: 16\n```\n\nThis method has a time complexity of O(n), where n is the length of the array."
    },
    {
      "link": "#what-are-asynchronous-thunks",
      "title": "What are asynchronous thunks",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Functional Programming",
      "text": "### What are asynchronous thunks?\n\nAsynchronous thunks are functions that return a function, which performs asynchronous operations. This allows you to delay the execution of a function, making it useful in scenarios such as API calls or working with promises.\n\nExample:\n\n```javascript\nconst fetchData = (url) => (dispatch) => {\n  fetch(url)\n    .then(response => response.json())\n    .then(data => dispatch(data));\n};\n```"
    },
    {
      "link": "#what-are-break-and-continue-statements",
      "title": "What are break and continue statements",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456440125774433569",
      "level": "basic",
      "theme": "JavaScript, control flow",
      "text": "### What are break and continue statements?\n\n- `break` is used to exit a loop prematurely.\n- `continue` is used to skip the current iteration and proceed to the next iteration of the loop.\n\nExample:\n\n```javascript\nfor (let i = 0; i < 5; i++) {\n  if (i === 3) break;\n  console.log(i); // 0, 1, 2\n}\n```"
    },
    {
      "link": "#what-are-compose-and-pipe-functions",
      "title": "What are compose and pipe functions?",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Functional Programming",
      "text": "### What are compose and pipe functions?\n\n**Compose** and **pipe** are utility functions used in functional programming to combine multiple functions.\n\n1. **Compose**:\n   - Executes functions from right to left.\n\n2. **Pipe**:\n   - Executes functions from left to right.\n\nExample:\n\n```javascript\nconst add = x => x + 1;\nconst multiply = x => x * 2;\n\n// Compose\nconst compose = (...fns) => x => fns.reduceRight((acc, fn) => fn(acc), x);\nconst composed = compose(multiply, add);\nconsole.log(composed(5)); // 12\n\n// Pipe\nconst pipe = (...fns) => x => fns.reduce((acc, fn) => fn(acc), x);\nconst piped = pipe(add, multiply);\nconsole.log(piped(5)); // 12\n```"
    },
    {
      "link": "#what-are-default-parameters",
      "title": "What are default parameters",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Functions",
      "text": "### What are default parameters?\n\nDefault parameters allow you to set default values for function parameters if no argument is provided when calling the function. This helps in avoiding `undefined` values.\n\nExample:\n\n```javascript\nfunction greet(name = 'Guest') {\n  console.log('Hello, ' + name);\n}\ngreet();  // Output: Hello, Guest\ngreet('John');  // Output: Hello, John\n```"
    },
    {
      "link": "#what-are-default-values-in-destructuring-assignment",
      "title": "What are default values in destructuring assignment",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Destructuring",
      "text": "### What are default values in destructuring assignment?\n\nDefault values in destructuring assignment allow you to assign a default value to a variable if the value being destructured is `undefined`. This is useful when destructuring objects or arrays with missing values.\n\nExample with array:\n\n```javascript\nlet [x = 10, y = 20] = [5];\nconsole.log(x, y);  // Output: 5 20\n```\nExample with object:\n\n```javascript\nlet { name = 'Guest', age = 25 } = { name: 'John' };\nconsole.log(name, age);  // Output: John 25\n```"
    },
    {
      "link": "#what-are-different-event-loops",
      "title": "What are different event loops",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Event Loop",
      "text": "### What are different event loops?\n\nJavaScript typically uses a single event loop to manage all asynchronous tasks. However, in the context of multiple threads or environments, you might have different event loops, such as in Web Workers, which have their own event loops.\n\n- **Main Event Loop**: Handles tasks in the main thread.\n- **Web Worker Event Loop**: Handles tasks in background threads."
    },
    {
      "link": "#what-are-dynamic-imports",
      "title": "What are dynamic imports",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Modules",
      "text": "### What are dynamic imports?\n\nDynamic imports allow you to load modules at runtime, rather than at the start of the script. This is useful for code splitting and loading modules on demand.\n\nExample:\n\n```javascript\nimport('module').then(module => {\n  module.someFunction();\n});\n```"
    },
    {
      "link": "#what-are-enhanced-object-literals",
      "title": "What are enhanced object literals",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Objects",
      "text": "### What are enhanced object literals?\n\nEnhanced object literals simplify the creation of objects by allowing shorthand for property names and method definitions, as well as the ability to compute property names.\n\nExample:\n\n```javascript\nlet name = 'John';\nlet person = {\n  name,\n  greet() {\n    console.log('Hello, ' + this.name);\n  }\n};\nperson.greet();  // Output: Hello, John\n```"
    },
    {
      "link": "#what-are-events",
      "title": "What are events",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7454560520000113952",
      "level": "basic",
      "theme": "JavaScript, events",
      "text": "### What are events?\n\nIn JavaScript, events are actions that occur in the browser, such as user interactions like clicks, keypresses, or page loading. JavaScript allows you to handle these events using event listeners."
    },
    {
      "link": "#what-are-hidden-classes",
      "title": "What are hidden classes?",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, V8 Engine",
      "text": "### What are hidden classes?\n\nHidden classes are an optimization technique used by JavaScript engines like V8 to enhance object property access performance. Instead of directly associating objects with their properties, the engine creates a hidden class to represent the object's structure.\n\n#### Key Points:\n1. **Dynamic Nature of JavaScript Objects:**\n   - JavaScript objects can have properties added or removed dynamically, making static optimization challenging.\n\n2. **Hidden Class Mechanism:**\n   - When an object is created, a hidden class is assigned to it.\n   - Adding or removing properties results in the creation of a new hidden class.\n\n3. **Optimization:**\n   - If objects share the same hidden class, the engine can use fast property lookups.\n\nExample:\n```javascript\nfunction Example() {\n  this.a = 1;\n  this.b = 2;\n}\n\nconst obj1 = new Example();\nconst obj2 = new Example();\n// Both obj1 and obj2 share the same hidden class.\n```"
    },
    {
      "link": "#what-are-javascript-accessors",
      "title": "What are javascript accessors",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### What are JavaScript accessors?\n\nAccessors are methods that allow you to get or set the value of an object's property. In JavaScript, accessors are usually implemented using `get` and `set` methods.\n\nExample:\n\n```javascript\nconst person = {\n  firstName: 'John',\n  lastName: 'Doe',\n  get fullName() { return this.firstName + ' ' + this.lastName; },\n  set fullName(name) { const parts = name.split(' '); this.firstName = parts[0]; this.lastName = parts[1]; }\n};\nconsole.log(person.fullName); // 'John Doe'\nperson.fullName = 'Jane Smith';\nconsole.log(person.firstName); // 'Jane'\n```"
    },
    {
      "link": "#what-are-js-labels",
      "title": "What are JS labels",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456494402261798177",
      "level": "basic",
      "theme": "JavaScript, control flow",
      "text": "### What are JS labels?\n\nA label in JavaScript is used to identify a loop or a block of code, allowing you to use `break` or `continue` to exit or skip to the labeled code.\n\nExample:\n\n```javascript\nouterLoop: for (let i = 0; i < 5; i++) {\n  for (let j = 0; j < 5; j++) {\n    if (i === 2 && j === 2) break outerLoop;\n  }\n}\n```"
    },
    {
      "link": "#what-are-modifiers-in-regular-expression",
      "title": "What are modifiers in regular expression",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456586559056268576",
      "level": "basic",
      "theme": "JavaScript, regular expressions",
      "text": "### What are modifiers in regular expression?\n\nModifiers are flags that alter the behavior of regular expressions. Common modifiers include:\n\n- `g` (global): Matches all occurrences.\n- `i` (ignore case): Ignores case when matching.\n- `m` (multiline): Treats beginning and end characters (^ and $) as working across multiple lines."
    },
    {
      "link": "#what-are-nesting-templates",
      "title": "What are nesting templates",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Strings",
      "text": "### What are nesting templates?\n\nNesting templates allows you to embed template literals inside another template literal. This is useful for constructing more complex strings with dynamic content.\n\nExample:\n\n```javascript\nlet name = 'John';\nlet message = `Hello, ${`Mr. ${name}`}!`;\nconsole.log(message);  // Output: Hello, Mr. John!\n```"
    },
    {
      "link": "#what-are-primitive-data-types",
      "title": "What are primitive data types",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, data types",
      "text": "### What are primitive data types?\n\nPrimitive data types in JavaScript are the most basic types of data. They are immutable and include:\n\n- `string`\n- `number`\n- `boolean`\n- `null`\n- `undefined`\n- `symbol` (ES6)\n- `bigint` (ES11)\n\nExample:\n\n```javascript\nconst name = 'John'; // string\nconst age = 30; // number\nconst isActive = true; // boolean\n```"
    },
    {
      "link": "#what-are-pwas",
      "title": "What are PWAs",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7453553728059215136",
      "level": "basic",
      "theme": "JavaScript, web technologies",
      "text": "### What are PWAs?\n\nProgressive Web Apps (PWAs) are web applications that use modern web capabilities to deliver an app-like experience to users. They are reliable, fast, and engaging, offering offline capabilities, push notifications, and the ability to be installed on the user's device."
    },
    {
      "link": "#what-are-raw-strings",
      "title": "What are raw strings",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Strings",
      "text": "### What are raw strings?\n\nRaw strings in JavaScript are used to access the raw string literals from template literals without escaping special characters like `\n` or `\t`.\n\nExample:\n\n```javascript\nlet rawStr = String.raw`Hello\nWorld`; \nconsole.log(rawStr);  // Output: Hello\\nWorld\n```"
    },
    {
      "link": "#what-are-regular-expression-patterns",
      "title": "What are regular expression patterns",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456908944020196641",
      "level": "basic",
      "theme": "JavaScript, regular expressions",
      "text": "### What are regular expression patterns?\n\nRegular expression patterns are sequences of characters that form search patterns. They are used to match strings based on specific rules. Patterns can include literals, special characters, and character classes.\n\nExample:\n\n```javascript\nconst regex = /\\d+/; // Matches one or more digits\nconsole.log('123abc'.match(regex)); // ['123']\n```"
    },
    {
      "link": "#what-are-tagged-templates",
      "title": "What are tagged templates",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Strings",
      "text": "### What are tagged templates?\n\nTagged templates allow you to parse a template literal with a function. The function is called with the string literals and interpolated expressions as arguments.\n\nExample:\n\n```javascript\nfunction tag(strings, ...values) {\n  console.log(strings, values);\n}\nlet name = 'John';\ntag`Hello, ${name}!`;  // Output: ['Hello, ', '!'] ['John']\n```"
    },
    {
      "link": "#what-are-tasks-in-event-loop",
      "title": "What are tasks in event loop",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Event Loop",
      "text": "### What are tasks in event loop?\n\nIn JavaScript, tasks (also called 'macrotasks') refer to operations in the event loop that are executed one by one. Each task is a block of code that is executed synchronously, like handling events, `setTimeout`, `setInterval`, etc.\n\nTasks are processed in the event loop, and when one task completes, the next one in the queue is executed."
    },
    {
      "link": "#what-are-template-literals",
      "title": "What are template literals",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Strings",
      "text": "### What are template literals?\n\nTemplate literals are a way to define strings that can contain expressions, making string interpolation easier. They are enclosed by backticks (` `) instead of quotes.\n\nExample:\n\n```javascript\nlet name = 'John';\nlet greeting = `Hello, ${name}!`;\nconsole.log(greeting);  // Output: Hello, John!\n```"
    },
    {
      "link": "#what-are-the-advantages-of-getters-and-setters",
      "title": "What are the advantages of Getters and Setters",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### What are the advantages of Getters and Setters?\n\nGetters and setters provide a controlled way to access and modify an object's properties. They allow you to define custom logic for setting or getting values and can help in encapsulating the internal state.\n\nExample:\n\n```javascript\nconst person = {\n  _name: 'John',\n  get name() { return this._name; },\n  set name(value) { this._name = value.toUpperCase(); }\n};\nperson.name = 'Jane';\nconsole.log(person.name); // 'JANE'\n```"
    },
    {
      "link": "#what-are-the-advantages-of-minification",
      "title": "What are the advantages of Minification",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, optimization",
      "text": "### What are the advantages of Minification?\n\nMinification provides several benefits:\n- **Reduced File Size**: Smaller file sizes mean faster download and loading times for users.\n- **Improved Performance**: Minified files are faster to download and execute, leading to better performance of the application.\n- **Reduced Bandwidth Usage**: Smaller files consume less bandwidth, which is beneficial for users with limited internet speed.\n\nTools like UglifyJS, Terser, and Google Closure Compiler can be used for minification."
    },
    {
      "link": "#what-are-the-advantages-of-module-loaders",
      "title": "What are the advantages of module loaders",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Modules",
      "text": "### What are the advantages of module loaders?\n\nModule loaders allow you to load JavaScript files and dependencies asynchronously, reducing page load times and enabling code splitting. They help in managing dependencies, modularizing code, and improving maintainability.\n\nExample: Tools like Webpack, RequireJS, and SystemJS are popular module loaders."
    },
    {
      "link": "#what-are-the-advantages-of-typescript-over-javascript",
      "title": "What are the advantages of TypeScript over JavaScript",
      "url": "",
      "level": "basic",
      "theme": "TypeScript",
      "text": "### What are the advantages of TypeScript over JavaScript?\n\nTypeScript offers several advantages over JavaScript:\n- **Static typing** helps catch errors early during development.\n- **Better tooling support** with autocompletion and code refactoring.\n- **Type inference** improves developer productivity and reduces errors.\n- **Support for modern JavaScript features** like async/await, decorators, etc., even in older browsers when transpiled.\n\nExample:\n\n```typescript\nfunction greet(person: string) {\n  console.log(`Hello, ${person}`);\n}\ngreet(42); // Error: Argument of type 'number' is not assignable to parameter of type 'string'.\n```"
    },
    {
      "link": "#what-are-the-applications-of-assign-method",
      "title": "What are the applications of assign method",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7458036822975712544",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### What are the applications of assign method?\n\n`Object.assign()` is used to copy properties from one or more source objects to a target object. It can be used for cloning objects or merging multiple objects into one.\n\nExample:\n\n```javascript\nconst target = { name: 'John' };\nconst source = { age: 30 };\nconst result = Object.assign(target, source);\nconsole.log(result); // { name: 'John', age: 30 }\n```"
    },
    {
      "link": "#what-are-the-applications-of-seal-method",
      "title": "What are the applications of seal method",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### What are the applications of seal method?\n\n`Object.seal()` is commonly used to lock an object to prevent new properties from being added, while still allowing modifications to existing properties. It can be useful in situations where you want to ensure the structure of an object remains unchanged.\n\nExample:\n\n```javascript\nconst person = { name: 'John' };\nObject.seal(person);\nperson.name = 'Jane'; // Allowed\nperson.city = 'New York'; // Not allowed\n```"
    },
    {
      "link": "#what-are-the-array-mutation-methods",
      "title": "What are the array mutation methods?",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays",
      "text": "### What are the array mutation methods?\n\nArray mutation methods directly modify the original array.\n\n1. **`push`:** Adds elements to the end.\n2. **`pop`:** Removes the last element.\n3. **`shift`:** Removes the first element.\n4. **`unshift`:** Adds elements to the beginning.\n5. **`splice`:** Adds/removes elements at a specific index.\n\nExample:\n```javascript\nconst arr = [1, 2, 3];\narr.push(4); // [1, 2, 3, 4]\narr.pop();  // [1, 2, 3]\n```"
    },
    {
      "link": "#what-are-the-attributes-provided-by-a-property-descriptor",
      "title": "What are the attributes provided by a property descriptor",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, objects",
      "text": "### What are the attributes provided by a property descriptor?\n\nA property descriptor in JavaScript is an object that describes the attributes of a property in an object. It contains the following attributes:\n\n- **value**: The value of the property.\n- **writable**: A boolean that indicates whether the value of the property can be changed.\n- **enumerable**: A boolean that indicates whether the property shows up in a `for...in` loop or `Object.keys()`.\n- **configurable**: A boolean that indicates whether the property can be deleted or modified.\n\nExample:\n\n```javascript\nconst person = { name: 'John' };\nconst descriptor = Object.getOwnPropertyDescriptor(person, 'name');\nconsole.log(descriptor);\n// { value: 'John', writable: true, enumerable: true, configurable: true }\n```"
    },
    {
      "link": "#what-are-the-available-constraint-validation-dom-properties",
      "title": "What are the available constraint validation DOM properties",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, DOM, validation",
      "text": "### What are the available constraint validation DOM properties?\n\nThe following properties are available for constraint validation in the DOM:\n\n- **validity**: An object that contains various validity states of the input element.\n- **valueMissing**: Returns `true` if the input is required but empty.\n- **typeMismatch**: Returns `true` if the input value doesn't match the expected type.\n- **tooLong**: Returns `true` if the value is too long for the field.\n- **rangeUnderflow**: Returns `true` if the value is less than the minimum value.\n\nExample:\n\n```javascript\nconst input = document.querySelector('input');\nconsole.log(input.validity.rangeUnderflow); // true or false\n```"
    },
    {
      "link": "#what-are-the-benefits-higher-order-functions",
      "title": "What are the benefits higher order functions?",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Functional Programming",
      "text": "### What are the benefits of higher-order functions?\n\n1. **Code Reusability:**\n   - Allows reusing logic by passing different functions.\n\n2. **Readability and Maintainability:**\n   - Makes code more declarative and easier to understand.\n\n3. **Functional Programming Support:**\n   - Encourages immutability and pure functions.\n\n4. **Abstraction:**\n   - Hides low-level details and focuses on high-level operations.\n\nExample:\n```javascript\nfunction applyOperation(arr, operation) {\n  return arr.map(operation);\n}\n\nconst numbers = [1, 2, 3];\nconst squared = applyOperation(numbers, num => num * num);\nconsole.log(squared); // [1, 4, 9]\n```"
    },
    {
      "link": "#what-are-the-benefits-of-initializing-variables",
      "title": "What are the benefits of initializing variables",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456552071349751073",
      "level": "basic",
      "theme": "JavaScript, best practices",
      "text": "### What are the benefits of initializing variables?\n\nInitializing variables ensures that they have a defined value when accessed, which helps avoid bugs caused by undefined variables and improves code reliability."
    },
    {
      "link": "#what-are-the-benefits-of-keeping-declarations-at-the-top",
      "title": "What are the benefits of keeping declarations at the top",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456506923873996065",
      "level": "basic",
      "theme": "JavaScript, best practices",
      "text": "### What are the benefits of keeping declarations at the top?\n\nDeclaring variables at the top of the scope helps avoid confusion and ensures that the variables are hoisted properly. This practice can also improve code readability and debugging."
    },
    {
      "link": "#what-are-the-bitwise-operators-available-in-javascript",
      "title": "What are the bitwise operators available in javascript",
      "url": "https://www.tiktok.com/@jsmentoring/video/7457690353714433312",
      "level": "basic",
      "theme": "JavaScript, operators",
      "text": "### What are the bitwise operators available in JavaScript?\n\nJavaScript supports several bitwise operators, including AND (`&`), OR (`|`), XOR (`^`), NOT (`~`), and shift operators (`<<`, `>>`, `>>>`).\n\nExample:\n\n```javascript\nconst a = 5; // 0101\nconst b = 3; // 0011\nconsole.log(a & b); // 1 (0101 & 0011 = 0001)\n```"
    },
    {
      "link": "#what-are-the-built-in-iterables",
      "title": "What are the built-in iterables",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Iterables",
      "text": "### What are the built-in iterables?\n\nBuilt-in iterables in JavaScript include:\n\n1. **Arrays**:\n   ```javascript\n   for (let item of [1, 2, 3]) {\n     console.log(item);\n   }\n   ```\n\n2. **Strings**:\n   ```javascript\n   for (let char of 'hello') {\n     console.log(char);\n   }\n   ```\n\n3. **Maps** and **Sets**:\n   ```javascript\n   let map = new Map([['a', 1]]);\n   for (let [key, value] of map) {\n     console.log(key, value);\n   }\n   ```\n\n4. **Typed Arrays** and **NodeLists**."
    },
    {
      "link": "#what-are-the-common-tools-used-for-minification",
      "title": "What are the common tools used for Minification",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, optimization",
      "text": "### What are the common tools used for Minification?\n\nThere are several tools available for minifying JavaScript code:\n- **UglifyJS**: A popular JavaScript minifier that can be used via the command line or as a library.\n- **Terser**: A JavaScript minifier that is a fork of UglifyJS, focused on modern JavaScript features.\n- **Google Closure Compiler**: A JavaScript optimizer that can minify and optimize JavaScript code.\n- **Babel Minify**: A minifier built specifically for Babel, targeting modern JavaScript features.\n\nThese tools remove unnecessary characters, such as spaces, comments, and newlines, to reduce the file size."
    },
    {
      "link": "#what-are-the-common-use-cases-of-observables",
      "title": "What are the common use cases of observables",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, RxJS",
      "text": "### What are the common use cases of Observables?\n\nObservables are useful for handling asynchronous events and streams of data. Common use cases include:\n\n- Handling multiple values over time (e.g., user inputs, WebSocket data, server responses)\n- Managing asynchronous sequences, like HTTP requests or animations\n- Implementing reactive programming patterns\n\nExample using RxJS for handling HTTP requests:\n\n```javascript\nimport { of } from 'rxjs';\n\nof('Data loaded').subscribe(data => console.log(data));\n```"
    },
    {
      "link": "#what-are-the-conventions-to-be-followed-for-the-usage-of-switch-case",
      "title": "What are the conventions to be followed for the usage of switch case",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, control structures",
      "text": "### What are the conventions to be followed for the usage of switch case?\n\nHere are some best practices for using `switch-case` in JavaScript:\n\n- Always include a `default` case to handle unexpected values.\n- Ensure each `case` ends with a `break` statement to avoid falling through to the next case.\n- Avoid using `switch-case` for complex conditions that can be handled with `if-else` statements.\n\nExample:\n\n```javascript\nconst number = 2;\nswitch(number) {\n  case 1:\n    console.log('One');\n    break;\n  case 2:\n    console.log('Two');\n    break;\n  default:\n    console.log('Unknown number');\n}\n```"
    },
    {
      "link": "#what-are-the-differences-between-arguments-object-and-rest-parameter",
      "title": "What are the differences between arguments object and rest parameter",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Functions",
      "text": "### What are the differences between arguments object and rest parameter?\n\n- **Arguments Object**:\n  - Array-like object available in every non-arrow function.\n  - Does not work with arrow functions.\n  - Does not support array methods directly.\n\n- **Rest Parameter**:\n  - Collects arguments into a real array.\n  - Works with all functions, including arrow functions.\n\nExample:\n\n```javascript\nfunction oldStyleFunction() {\n  console.log(arguments);  // Array-like\n}\n\nconst newStyleFunction = (...args) => {\n  console.log(args);  // Array\n};\n\noldStyleFunction(1, 2, 3);\nnewStyleFunction(1, 2, 3);\n```"
    },
    {
      "link": "#what-are-the-differences-between-forof-and-forin-statements",
      "title": "What are the differences between for...of and for...in statements",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Loops",
      "text": "### What are the differences between for...of and for...in statements?\n\n- **`for...of`**:\n  - Iterates over values of an iterable (e.g., array, string, Map).\n  - Example:\n    ```javascript\n    for (let value of [10, 20, 30]) {\n      console.log(value); // 10, 20, 30\n    }\n    ```\n\n- **`for...in`**:\n  - Iterates over keys or properties of an object.\n  - Example:\n    ```javascript\n    for (let key in { a: 1, b: 2 }) {\n      console.log(key); // 'a', 'b'\n    }\n    ```"
    },
    {
      "link": "#what-are-the-differences-between-freeze-and-seal-methods",
      "title": "What are the differences between freeze and seal methods",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### What are the differences between freeze and seal methods?\n\nBoth `Object.freeze()` and `Object.seal()` prevent modification of an object, but with different restrictions:\n\n- `Object.freeze()` makes an object immutable, preventing changes to existing properties, and disallowing the addition or removal of properties.\n- `Object.seal()` allows modification of existing properties but prevents the addition of new properties.\n\nExample:\n\n```javascript\nconst obj1 = { name: 'John' };\nObject.freeze(obj1);\nobj1.name = 'Jane'; // Not allowed\nobj1.age = 30; // Not allowed\n\nconst obj2 = { name: 'John' };\nObject.seal(obj2);\nobj2.name = 'Jane'; // Allowed\nobj2.age = 30; // Not allowed\n```"
    },
    {
      "link": "#what-are-the-differences-between-javascript-and-typescript",
      "title": "What are the differences between JavaScript and TypeScript",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, TypeScript",
      "text": "### What are the differences between JavaScript and TypeScript?\n\nThe key differences between JavaScript and TypeScript include:\n- **TypeScript** has optional static typing, while **JavaScript** is dynamically typed.\n- **TypeScript** supports modern JavaScript features and compiles down to JavaScript, while **JavaScript** is interpreted directly by the browser or Node.js.\n- **TypeScript** provides better tooling and editor support with features like type inference, autocompletion, and error checking during development.\n\nExample:\n\n```typescript\nlet age: number = 30; // TypeScript\nlet name = 'John'; // JavaScript\n```"
    },
    {
      "link": "#what-are-the-differences-between-obfuscation-and-encryption",
      "title": "What are the differences between Obfuscation and Encryption",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, security",
      "text": "### What are the differences between Obfuscation and Encryption?\n\nObfuscation and encryption both aim to protect data, but they serve different purposes:\n- **Obfuscation**: The goal is to make the code or data difficult to understand for humans but does not prevent someone from reversing it with enough time or effort. It's used primarily for source code protection.\n- **Encryption**: The goal is to transform data into a format that cannot be easily read or accessed without the proper decryption key. Encryption is more secure than obfuscation and is often used for securing sensitive information.\n\nExample:\n- Obfuscation might involve renaming variables in a script.\n- Encryption involves transforming data into a coded format using an encryption algorithm."
    },
    {
      "link": "#what-are-the-differences-between-primitives-and-non-primitives",
      "title": "What are the differences between primitives and non-primitives?",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Data Types",
      "text": "### What are the differences between primitives and non-primitives?\n\n**Primitives**:\n- Immutable, basic data types (e.g., `string`, `number`, `boolean`, `null`, `undefined`, `Symbol`, `BigInt`).\n- Stored directly in memory.\n\n**Non-primitives**:\n- Objects, arrays, and functions.\n- Mutable and stored as references in memory.\n\nExample:\n\n```javascript\nlet a = 10; // Primitive\nlet b = a;\nb = 20;\nconsole.log(a); // 10 (no change)\n\nlet obj = { key: 'value' }; // Non-primitive\nlet ref = obj;\nref.key = 'newValue';\nconsole.log(obj.key); // 'newValue' (reference changed)\n```"
    },
    {
      "link": "#what-are-the-differences-between-promises-and-observables",
      "title": "What are the differences between promises and observables",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Promises, Observables",
      "text": "### What are the differences between Promises and Observables?\n\nPromises and Observables are both used for handling asynchronous operations, but they have key differences:\n\n- **Promises**: Represent a single value that will be resolved or rejected in the future.\n- **Observables**: Represent a stream of values that can emit multiple values over time.\n\nExample of Promise:\n\n```javascript\nlet promise = new Promise((resolve, reject) => { resolve('Resolved'); });\n```"
    },
    {
      "link": "#what-are-the-differences-between-pure-and-impure-functions",
      "title": "What are the differences between pure and impure functions?",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Functional Programming",
      "text": "### What are the differences between pure and impure functions?\n\n**Pure Functions**:\n- Always return the same output for the same input.\n- No side effects (e.g., modifying global variables or external state).\n\n**Impure Functions**:\n- Output depends on external factors or internal state.\n- May produce side effects.\n\nExample:\n\n```javascript\n// Pure Function\nfunction add(a, b) {\n  return a + b;\n}\n\n// Impure Function\nlet count = 0;\nfunction increment() {\n  count++;\n  return count;\n}\n```"
    },
    {
      "link": "#what-are-the-differences-between-spread-operator-and-rest-parameter",
      "title": "What are the differences between spread operator and rest parameter",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Operators",
      "text": "### What are the differences between spread operator and rest parameter?\n\n- **Spread Operator**:\n  - Expands elements of an array or object into individual elements.\n  - Used in function calls, array literals, or object literals.\n\n- **Rest Parameter**:\n  - Collects all remaining arguments into a single array.\n  - Used in function definitions.\n\nExample:\n\n```javascript\n// Spread Operator\nconst numbers = [1, 2, 3];\nconsole.log(...numbers); // Output: 1 2 3\n\n// Rest Parameter\nfunction sum(...args) {\n  return args.reduce((acc, curr) => acc + curr, 0);\n}\nconsole.log(sum(1, 2, 3)); // Output: 6\n```"
    },
    {
      "link": "#what-are-the-differences-between-weakmap-and-map",
      "title": "What are the differences between WeakMap and Map",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7458189087422401825",
      "level": "basic",
      "theme": "JavaScript, collections",
      "text": "### What are the differences between WeakMap and Map?\n\n- A `WeakMap` holds key-value pairs where the keys are objects and are held weakly, meaning they can be garbage collected if no other references exist.\n- A `Map` holds key-value pairs where the keys can be of any data type and are held strongly.\n\nExample:\n\n```javascript\nconst obj = { name: 'John' };\nconst weakmap = new WeakMap();\nconst map = new Map();\nweakmap.set(obj, 'value');\nmap.set(obj, 'value');\n```"
    },
    {
      "link": "#what-are-the-differences-between-weakset-and-set",
      "title": "What are the differences between WeakSet and Set",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7458240152905846048",
      "level": "basic",
      "theme": "JavaScript, collections",
      "text": "### What are the differences between WeakSet and Set?\n\n- A `WeakSet` holds weak references to its objects, which allows garbage collection when the objects are no longer referenced elsewhere.\n- A `Set` holds strong references to its elements, preventing garbage collection until the set itself is garbage collected.\n- `WeakSet` can only store objects, while `Set` can store any type of value.\n\nExample:\n\n```javascript\nconst obj1 = { name: 'John' };\nconst weakset = new WeakSet([obj1]);\nconst set = new Set([obj1]);\n```"
    },
    {
      "link": "#what-are-the-different-error-names-from-error-object",
      "title": "What are the different error names from error object",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, errors",
      "text": "### What are the different error names from error object?\n\nJavaScript provides several types of error objects:\n\n- `Error` – General errors\n- `SyntaxError` – Syntax issues in code\n- `ReferenceError` – Reference to a non-existent variable\n- `TypeError` – Wrong data type used\n- `RangeError` – A value is out of range\n- `EvalError` – Issues with `eval()` function\n\nExample:\n\n```javascript\ntry {\n  let x = y;\n} catch (e) {\n  console.log(e instanceof ReferenceError); // true\n}\n```"
    },
    {
      "link": "#what-are-the-different-kinds-of-generators",
      "title": "What are the different kinds of generators",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Generators",
      "text": "### What are the different kinds of generators?\n\nGenerators can be categorized based on their usage:\n\n1. **Simple Generators**: Yield a series of values.\n   ```javascript\n   function* simpleGenerator() {\n     yield 1;\n     yield 2;\n     yield 3;\n   }\n   ```\n\n2. **Delegating Generators**: Use `yield*` to delegate to another generator or iterable.\n   ```javascript\n   function* delegatingGenerator() {\n     yield* [1, 2, 3];\n   }\n   ```\n\n3. **Asynchronous Generators**: Use `async` and `for await...of` for asynchronous operations.\n   ```javascript\n   async function* asyncGenerator() {\n     yield await Promise.resolve(1);\n   }\n   ```"
    },
    {
      "link": "#what-are-the-different-methods-to-find-html-elements-in-dom",
      "title": "What are the different methods to find HTML elements in DOM",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, DOM manipulation",
      "text": "### What are the different methods to find HTML elements in DOM?\n\nIn JavaScript, you can find HTML elements in the DOM using various methods:\n\n- **`getElementById()`**: Finds an element by its `id` attribute.\n- **`getElementsByClassName()`**: Finds elements by their `class` attribute.\n- **`getElementsByTagName()`**: Finds elements by their tag name.\n- **`querySelector()`**: Finds the first element that matches a CSS selector.\n- **`querySelectorAll()`**: Finds all elements that match a CSS selector.\n\nExample:\n\n```javascript\nconst element = document.getElementById('myElement');\nconst elements = document.getElementsByClassName('myClass');\n```"
    },
    {
      "link": "#what-are-the-different-ways-to-access-object-properties",
      "title": "What are the different ways to access object properties",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### What are the different ways to access object properties?\n\nThere are three primary ways to access properties of an object in JavaScript:\n\n1. Dot notation: `object.property`\n2. Bracket notation: `object['property']`\n3. Using `Object.getOwnPropertyDescriptor()`\n\nExample:\n\n```javascript\nconst person = { name: 'John', age: 30 };\nconsole.log(person.name); // Dot notation\nconsole.log(person['age']); // Bracket notation\n```"
    },
    {
      "link": "#what-are-the-different-ways-to-create-sparse-arrays",
      "title": "What are the different ways to create sparse arrays?",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Arrays",
      "text": "### What are the different ways to create sparse arrays?\n\n1. **Using Array Constructor**:\n   ```javascript\n   const sparseArray = new Array(3); // Creates [ <3 empty items> ]\n   ```\n\n2. **Using Comma Syntax**:\n   ```javascript\n   const sparseArray = [1, , 3]; // Creates [1, <1 empty item>, 3]\n   ```\n\n3. **Deleting Elements**:\n   ```javascript\n   const array = [1, 2, 3];\n   delete array[1]; // Creates [1, <1 empty item>, 3]\n   ```"
    },
    {
      "link": "#what-are-the-different-ways-to-deal-with-asynchronous-code",
      "title": "What are the different ways to deal with Asynchronous Code",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Asynchronous Programming",
      "text": "### What are the different ways to deal with Asynchronous Code?\n\nJavaScript offers several ways to handle asynchronous code, including callbacks, promises, and async/await.\n\n- **Callbacks**: A function passed as an argument to be executed later.\n- **Promises**: A value that represents the eventual result of an asynchronous operation.\n- **Async/Await**: A modern syntax for handling promises in a synchronous-like manner.\n\nExample using `async/await`:\n\n```javascript\nasync function fetchData() {\n  let response = await fetch('https://api.example.com/data');\n  let data = await response.json();\n  console.log(data);\n}\nfetchData();\n```"
    },
    {
      "link": "#what-are-the-different-ways-to-execute-external-scripts",
      "title": "What are the different ways to execute external scripts?",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, HTML",
      "text": "### What are the different ways to execute external scripts?\n\n1. **Using `<script>` Tag:**\n   - Include the script in your HTML file.\n   ```html\n   <script src=\"script.js\"></script>\n   ```\n\n2. **Dynamically Injecting Scripts:**\n   - Use JavaScript to add scripts to the DOM.\n   ```javascript\n   const script = document.createElement('script');\n   script.src = 'script.js';\n   document.body.appendChild(script);\n   ```\n\n3. **Using `import` (ES Modules):**\n   - Load scripts as ES modules.\n   ```javascript\n   import { myFunction } from './script.js';\n   myFunction();\n   ```\n\n4. **Using `require` (Node.js):**\n   - Load scripts in Node.js environments.\n   ```javascript\n   const module = require('./script.js');\n   module.myFunction();\n   ```"
    },
    {
      "link": "#what-are-the-different-ways-to-make-an-object-non-extensible",
      "title": "What are the different ways to make an object non-extensible",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### What are the different ways to make an object non-extensible?\n\nYou can make an object non-extensible in JavaScript in several ways:\n- Using `Object.preventExtensions()` makes an object non-extensible.\n- Using `Object.seal()` not only prevents extensions but also makes all existing properties non-configurable.\n- Using `Object.freeze()` prevents extensions and makes all properties immutable.\n\nExample:\n\n```javascript\nconst obj = { name: 'John' };\nObject.preventExtensions(obj);\nconsole.log(Object.isExtensible(obj)); // false\n```"
    },
    {
      "link": "#what-are-the-dom-methods-available-for-constraint-validation",
      "title": "What are the DOM methods available for constraint validation",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, DOM, validation",
      "text": "### What are the DOM methods available for constraint validation?\n\nIn JavaScript, constraint validation methods are used to check the validity of form inputs according to the constraints defined in the HTML form elements. The following DOM methods are available for constraint validation:\n\n- **checkValidity()**: Checks if the element satisfies all constraints.\n- **reportValidity()**: Checks validity and shows an error message if the element is invalid.\n- **setCustomValidity()**: Allows you to define a custom error message for validation.\n\nExample:\n\n```javascript\nconst input = document.querySelector('input');\nif (!input.checkValidity()) {\n  console.log('Input is invalid');\n}\n```"
    },
    {
      "link": "#what-are-the-event-phases-of-a-browser",
      "title": "What are the event phases of a browser?",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Events",
      "text": "### What are the event phases of a browser?\n\nThere are three main phases of event propagation in the browser:\n\n1. **Capturing Phase (Capture):**\n   - Event travels from the root to the target element.\n\n2. **Target Phase:**\n   - Event reaches the target element.\n\n3. **Bubbling Phase (Bubble):**\n   - Event propagates back from the target to the root.\n\nExample:\n```javascript\ndocument.getElementById('myDiv').addEventListener('click', event => {\n  console.log('Capturing Phase');\n}, true);\n\ndocument.getElementById('myDiv').addEventListener('click', event => {\n  console.log('Bubbling Phase');\n});\n```"
    },
    {
      "link": "#what-are-the-examples-of-built-in-higher-order-functions",
      "title": "What are the examples of built-in higher order functions?",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Functional Programming",
      "text": "### What are the examples of built-in higher-order functions?\n\nHigher-order functions are functions that can accept other functions as arguments or return functions. Examples of built-in higher-order functions in JavaScript include:\n\n1. **`map`**:\n   ```javascript\n   const numbers = [1, 2, 3];\n   const doubled = numbers.map(num => num * 2);\n   console.log(doubled); // [2, 4, 6]\n   ```\n\n2. **`filter`**:\n   ```javascript\n   const numbers = [1, 2, 3, 4];\n   const evens = numbers.filter(num => num % 2 === 0);\n   console.log(evens); // [2, 4]\n   ```\n\n3. **`reduce`**:\n   ```javascript\n   const numbers = [1, 2, 3, 4];\n   const sum = numbers.reduce((total, num) => total + num, 0);\n   console.log(sum); // 10\n   ```\n\n4. **`forEach`**:\n   ```javascript\n   const numbers = [1, 2, 3];\n   numbers.forEach(num => console.log(num));\n   ```\n\n5. **`sort`**:\n   ```javascript\n   const names = ['Charlie', 'Alice', 'Bob'];\n   names.sort((a, b) => a.localeCompare(b));\n   console.log(names); // ['Alice', 'Bob', 'Charlie']\n   ```"
    },
    {
      "link": "#what-are-the-function-parameter-rules",
      "title": "What are the function parameter rules",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, functions",
      "text": "### What are the function parameter rules?\n\n- Function parameters are the variables listed in a function's declaration.\n- JavaScript functions can have default parameters.\n- Parameters are passed in the order they are listed.\n- A function can accept any number of arguments, but the excess arguments will be ignored unless using the `...rest` parameter.\n\nExample:\n\n```javascript\nfunction greet(name = 'Guest') {\n  console.log('Hello, ' + name);\n}\ngreet(); // 'Hello, Guest'\ngreet('John'); // 'Hello, John'\n```"
    },
    {
      "link": "#what-are-the-list-of-cases-error-thrown-from-non-strict-mode-to-strict-mode",
      "title": "What are the list of cases error thrown from non-strict mode to strict mode",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Strict Mode",
      "text": "### What are the list of cases error thrown from non-strict mode to strict mode?\n\nIn strict mode, JavaScript imposes stricter parsing and error handling. Some common errors that occur when switching from non-strict to strict mode include:\n- Assignment to undeclared variables\n- Assigning to read-only properties\n- Deleting undeletable properties\n\nExample:\n\n```javascript\n'use strict';\nundeclaredVar = 10;  // Throws ReferenceError\n```"
    },
    {
      "link": "#what-are-the-list-of-validity-properties",
      "title": "What are the list of validity properties",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, DOM, validation",
      "text": "### What are the list of validity properties?\n\nHere is a list of validity properties that you can access through the `validity` property of an input element:\n\n- **valueMissing**: If the field is required but not filled in.\n- **typeMismatch**: If the input value does not match the expected type.\n- **patternMismatch**: If the value doesn't match the regular expression pattern defined.\n- **tooLong**: If the value exceeds the `maxlength` constraint.\n- **tooShort**: If the value is too short according to the `minlength` constraint.\n- **rangeUnderflow**: If the value is less than the `min` attribute.\n- **rangeOverflow**: If the value is greater than the `max` attribute.\n- **stepMismatch**: If the value does not meet the step constraint.\n- **badInput**: If the input value is not valid for the input type.\n- **customError**: If a custom validation error has been set using `setCustomValidity`."
    },
    {
      "link": "#what-are-the-optimization-techniques-of-v8-engine",
      "title": "What are the optimization techniques of V8 engine?",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Engines",
      "text": "### What are the optimization techniques of V8 engine?\n\n1. **Just-In-Time (JIT) Compilation:**\n   - Converts JavaScript into machine code during runtime.\n\n2. **Hidden Classes:**\n   - Creates optimized data structures for objects with the same properties.\n\n3. **Inline Caching:**\n   - Speeds up property access by reusing previous lookups.\n\n4. **Garbage Collection:**\n   - Automatically reclaims memory no longer in use.\n\nExample:\n\n```javascript\nconst obj = { a: 1, b: 2 };\nconsole.log(obj.a); // Inline caching used after first lookup\n```"
    },
    {
      "link": "#what-are-the-phases-of-execution-context",
      "title": "What are the phases of execution context?",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Execution Context",
      "text": "### What are the phases of execution context?\n\n1. **Creation Phase:**\n   - Memory is allocated for variables and functions.\n   - Variables are initialized with `undefined`.\n   - Functions are stored as-is.\n\n2. **Execution Phase:**\n   - Code is executed line by line.\n   - Variables are assigned actual values.\n\nExample:\n\n```javascript\nfunction test() {\n  console.log(a); // undefined (creation phase)\n  var a = 10;\n  console.log(a); // 10 (execution phase)\n}\n\ntest();\n```"
    },
    {
      "link": "#what-are-the-placeholders-from-console-object",
      "title": "What are the placeholders from console object",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Console",
      "text": "### What are the placeholders from console object?\n\nThe `console` object in JavaScript supports placeholders like `%s`, `%d`, and `%o` for formatted output. These placeholders allow you to format and display data in the console in a more readable way.\n\nExample:\n\n```javascript\nlet name = 'Alice';\nlet age = 25;\nconsole.log('Name: %s, Age: %d', name, age);  // Output: 'Name: Alice, Age: 25'\n```"
    },
    {
      "link": "#what-are-the-possible-reasons-for-memory-leaks",
      "title": "What are the possible reasons for memory leaks?",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Performance",
      "text": "### What are the possible reasons for memory leaks?\n\n1. **Global Variables:**\n   ```javascript\n   var leak = 'This is a memory leak';\n   ```\n\n2. **Uncleared Intervals/Timeouts:**\n   ```javascript\n   setInterval(() => console.log('Leaking memory'), 1000);\n   ```\n\n3. **Detached DOM Nodes:**\n   ```javascript\n   const element = document.getElementById('myElement');\n   element.parentNode.removeChild(element); // Still referenced in memory\n   ```\n\n4. **Closures Holding References:**\n   ```javascript\n   function leak() {\n     let bigArray = new Array(1000000);\n     return function() {\n       console.log(bigArray);\n     };\n   }\n   ```"
    },
    {
      "link": "#what-are-the-possible-side-effects-in-javascript",
      "title": "What are the possible side-effects in javascript?",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Functional Programming",
      "text": "### What are the possible side-effects in JavaScript?\n\nSide effects occur when a function interacts with or modifies something outside its scope. Examples include:\n\n1. Modifying global variables or objects.\n2. Logging to the console.\n3. Making network requests (e.g., `fetch`).\n4. DOM manipulation.\n\nExample:\n\n```javascript\n// Side Effect: Modifying a global variable\nlet count = 0;\nfunction increment() {\n  count++;\n}\n\n// Side Effect: Logging to the console\nfunction logMessage(message) {\n  console.log(message);\n}\n```"
    },
    {
      "link": "#what-are-the-problems-with-postmessage-target-origin-as-wildcard",
      "title": "What are the problems with postMessage target origin as wildcard",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Security",
      "text": "### What are the problems with postMessage target origin as wildcard?\n\nUsing `*` as the `targetOrigin` in `postMessage` allows any origin to receive the message, which can expose your data to malicious actors. Always specify the exact origin to ensure secure communication.\n\nExample:\n\n```javascript\nwindow.postMessage('message', '*');  // Insecure\n```"
    },
    {
      "link": "#what-are-the-properties-of-intl-object",
      "title": "What are the properties of Intl object",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, internationalization",
      "text": "### What are the properties of the Intl object?\n\nThe `Intl` object in JavaScript provides several properties and methods to help with internationalization. Some of the main properties include:\n\n- `Intl.NumberFormat`\n- `Intl.DateTimeFormat`\n- `Intl.Collator`\n- `Intl.ListFormat`\n- `Intl.RelativeTimeFormat`\n\nThese objects allow you to format numbers, dates, and compare strings based on different locales.\n\nExample:\n\n```javascript\nconst formatter = new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' });\nconsole.log(formatter.format(1000)); // '$1,000.00'\n```"
    },
    {
      "link": "#what-are-the-properties-used-to-get-size-of-window",
      "title": "What are the properties used to get size of window",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456924943062715680",
      "level": "basic",
      "theme": "JavaScript, window properties",
      "text": "### What are the properties used to get size of window?\n\nTo get the size of the window, you can use `window.innerWidth` and `window.innerHeight` for the dimensions of the viewport.\n\nExample:\n\n```javascript\nconsole.log(window.innerWidth, window.innerHeight);\n```"
    },
    {
      "link": "#what-are-the-pros-and-cons-of-for-loops",
      "title": "What are the pros and cons of for loops",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, loops",
      "text": "### What are the pros and cons of for loops?\n\n**Pros**: `for` loops are simple, efficient, and widely supported. They provide complete control over the iteration.\n\n**Cons**: Can be error-prone, especially with complex conditions or manual index management."
    },
    {
      "link": "#what-are-the-pros-and-cons-of-promises-over-callbacks",
      "title": "What are the pros and cons of promises over callbacks",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7453226425227726112",
      "level": "advanced",
      "theme": "JavaScript, promises",
      "text": "### What are the pros and cons of promises over callbacks?\n\nPromises provide cleaner, more readable code with `.then()` and `.catch()` methods. They avoid callback hell, but can introduce complexity with chaining and error handling."
    },
    {
      "link": "#what-are-the-real-world-use-cases-of-proxy",
      "title": "What are the real world use cases of proxy?",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Proxy",
      "text": "### What are the real-world use cases of Proxy?\n\n1. **Validation:**\n   ```javascript\n   const validator = {\n     set(obj, prop, value) {\n       if (prop === 'age' && typeof value !== 'number') {\n         throw new Error('Age must be a number');\n       }\n       obj[prop] = value;\n       return true;\n     }\n   };\n   const person = new Proxy({}, validator);\n   person.age = 25; // Valid\n   person.age = 'twenty'; // Throws Error\n   ```\n\n2. **Property Access Control:**\n   ```javascript\n   const handler = {\n     get(target, prop) {\n       return prop in target ? target[prop] : 'Property does not exist';\n     }\n   };\n   const obj = new Proxy({}, handler);\n   console.log(obj.name); // 'Property does not exist'\n   ```\n\n3. **Performance Optimization:**\n   - Proxy can be used to lazy-load properties or cache data dynamically."
    },
    {
      "link": "#what-are-the-recommendations-to-create-new-object",
      "title": "What are the recommendations to create new object",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456561892916563233",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### What are the recommendations to create new objects?\n\nUse object literals `{}` or `Object.create()` to create objects in JavaScript. The object literal syntax is simple and efficient for most use cases.\n\nExample:\n\n```javascript\nconst obj = { name: 'John', age: 30 };\n```"
    },
    {
      "link": "#what-are-the-steps-involved-in-return-false-usage",
      "title": "What are the steps involved in return false usage",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456163504303787297",
      "level": "intermediate",
      "theme": "JavaScript, events",
      "text": "### What are the steps involved in return false usage?\n\n`return false` is used to prevent both the default behavior and the event propagation in one step. It can be used in an event handler to stop the event from bubbling and cancel the default action."
    },
    {
      "link": "#what-are-the-string-methods-that-accept-regular-expression",
      "title": "What are the string methods that accept Regular expression",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, regular expressions",
      "text": "### What are the string methods that accept Regular expression?\n\nString methods like `match()`, `replace()`, `search()`, and `split()` accept regular expressions to perform pattern matching and replacement in strings."
    },
    {
      "link": "#what-are-the-syntax-rules-of-json",
      "title": "What are the syntax rules of JSON",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7453777976652467489",
      "level": "basic",
      "theme": "JavaScript, data formats",
      "text": "### What are the syntax rules of JSON?\n\nJSON syntax rules include using double quotes for keys and string values, no trailing commas, and values can be strings, numbers, objects, arrays, true, false, or null."
    },
    {
      "link": "#what-are-the-tools-or-techniques-used-for-debugging-javascript-code",
      "title": "What are the tools or techniques used for debugging JavaScript code",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7454541000824917281",
      "level": "intermediate",
      "theme": "JavaScript, debugging",
      "text": "### What are the tools or techniques used for debugging JavaScript code?\n\nCommon debugging techniques include using `console.log()`, browser developer tools (F12), breakpoints, and using debuggers like Chrome DevTools or Visual Studio Code."
    },
    {
      "link": "#what-are-the-two-types-of-loops-in-javascript",
      "title": "What are the two types of loops in javascript",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, loops",
      "text": "### What are the two types of loops in JavaScript?\n\nThere are two main types of loops in JavaScript:\n\n1. **For loop** – Repeats a block of code a certain number of times.\n2. **While loop** – Repeats a block of code while a specified condition is true.\n\nExample:\n\n```javascript\nfor (let i = 0; i < 5; i++) {\n  console.log(i);\n}\n\nlet j = 0;\nwhile (j < 5) {\n  console.log(j);\n  j++;\n}\n```"
    },
    {
      "link": "#what-are-the-use-cases-for-dynamic-imports",
      "title": "What are the use cases for dynamic imports",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Modules",
      "text": "### What are the use cases for dynamic imports?\n\nDynamic imports are useful for lazy loading, where modules are loaded only when they are needed, improving the initial load time of a web application. They are also helpful in code splitting and on-demand loading of specific features or components.\n\nExample:\n\n```javascript\nif (userWantsFeature) {\n  import('./feature.js').then(feature => {\n    feature.init();\n  });\n}\n```"
    },
    {
      "link": "#what-are-the-uses-of-closures",
      "title": "What are the uses of closures?",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Closures",
      "text": "### What are the uses of closures?\n\nClosures allow a function to retain access to its outer scope, even after the outer function has returned. Common uses include:\n\n1. **Data Encapsulation:**\n   ```javascript\n   function counter() {\n     let count = 0;\n     return function() {\n       return ++count;\n     };\n   }\n   const increment = counter();\n   console.log(increment()); // 1\n   console.log(increment()); // 2\n   ```\n\n2. **Event Handlers:**\n   ```javascript\n   function setupEventListener() {\n     let name = 'ClickMe';\n     document.addEventListener('click', function() {\n       console.log(`Button ${name} clicked`);\n     });\n   }\n   setupEventListener();\n   ```"
    },
    {
      "link": "#what-are-the-various-statements-in-error-handling",
      "title": "What are the various statements in error handling",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, errors",
      "text": "### What are the various statements in error handling?\n\nIn JavaScript, the main statements used for error handling are:\n\n- `try` – Used to wrap the code that may throw an error.\n- `catch` – Used to handle errors that occur in the `try` block.\n- `finally` – A block of code that runs after `try` and `catch`, regardless of whether an error was thrown.\n\nExample:\n\n```javascript\ntry {\n  throw new Error('Something went wrong');\n} catch (e) {\n  console.log(e.message);\n} finally {\n  console.log('This will always run');\n}\n```"
    },
    {
      "link": "#what-are-the-various-url-properties-of-location-object",
      "title": "What are the various URL properties of location object",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7455459948529487136",
      "level": "basic",
      "theme": "JavaScript, web navigation",
      "text": "### What are the various URL properties of the location object?\n\nThe `location` object has several properties, including `href`, `protocol`, `hostname`, `pathname`, `search`, and `hash`, which allow you to get and manipulate different parts of the current URL."
    },
    {
      "link": "#what-are-the-ways-to-execute-javascript-after-page-load",
      "title": "What are the ways to execute javascript after page load",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7457929884061469985",
      "level": "basic",
      "theme": "JavaScript, page load",
      "text": "### What are the ways to execute JavaScript after page load?\n\nYou can execute JavaScript after the page loads using the `window.onload` event or by using `DOMContentLoaded` event. Additionally, you can use `setTimeout()` or `setInterval()` to delay the execution.\n\nExample:\n\n```javascript\nwindow.onload = function() {\n  console.log('Page loaded');\n};\n```"
    },
    {
      "link": "#what-are-typed-arrays",
      "title": "What are typed arrays",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Arrays",
      "text": "### What are typed arrays?\n\nTyped arrays are arrays that allow you to work with binary data. They provide a mechanism for dealing with raw binary data buffers in JavaScript, offering various array-like objects that represent different binary data formats.\n\nExample:\n\n```javascript\nlet buffer = new ArrayBuffer(16);\nlet int32View = new Int32Array(buffer);\nint32View[0] = 42;\nconsole.log(int32View[0]);  // Output: 42\n```"
    },
    {
      "link": "#what-are-various-operators-supported-by-javascript",
      "title": "What are various operators supported by javascript",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7457453251810561313",
      "level": "basic",
      "theme": "JavaScript, operators",
      "text": "### What are various operators supported by JavaScript?\n\nJavaScript supports several types of operators, including arithmetic operators, comparison operators, logical operators, and assignment operators.\n\nExamples:\n\n- Arithmetic: `+`, `-`, `*`, `/`\n- Comparison: `==`, `!=`, `>`, `<`\n- Logical: `&&`, `||`\n- Assignment: `=`, `+=`, `-=`"
    },
    {
      "link": "#what-are-wrapper-objects",
      "title": "What are wrapper objects",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Data Types",
      "text": "### What are wrapper objects?\n\nWrapper objects in JavaScript are objects that wrap primitive values (like `String`, `Number`, and `Boolean`). They allow you to call methods on primitive types.\n\nExample:\n\n```javascript\nlet str = 'hello';\nlet strObj = new String(str);\nconsole.log(strObj.toUpperCase());  // Output: 'HELLO'\n```"
    },
    {
      "link": "#what-happens-if-i-pass-string-type-for-getprototype-method",
      "title": "What happens If I pass string type for getPrototype method",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### What happens If I pass string type for getPrototype method?\n\nIf you pass a string type to the `Object.getPrototypeOf()` method, it will throw a `TypeError` because the argument must be an object. The `getPrototypeOf` method only works on objects, and passing a primitive value like a string is invalid.\n\nExample:\n\n```javascript\nconst str = 'hello';\nconsole.log(Object.getPrototypeOf(str)); // Works fine\nconsole.log(Object.getPrototypeOf('hello')); // TypeError\n```"
    },
    {
      "link": "#what-happens-if-we-add-two-arrays",
      "title": "What happens if we add two arrays",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays",
      "text": "### What happens if we add two arrays?\n\nIn JavaScript, adding two arrays does not perform element-wise addition. Instead, it concatenates them into a new array, but if you add them directly, it will convert them to strings and concatenate those.\n\nExample:\n\n```javascript\nlet arr1 = [1, 2, 3];\nlet arr2 = [4, 5, 6];\nconsole.log(arr1 + arr2);  // Output: '1,2,34,5,6'\n```"
    },
    {
      "link": "#what-happens-if-you-do-not-use-rest-parameter-as-a-last-argument",
      "title": "What happens if you do not use rest parameter as a last argument",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, functions",
      "text": "### What happens if you do not use rest parameter as a last argument?\n\nThe rest parameter must always be the last argument in a function. If it is not, JavaScript will throw a syntax error.\n\nExample:\n\n```javascript\nfunction myFunction(a, ...rest, b) { // SyntaxError\n}\n```"
    },
    {
      "link": "#what-happens-if-you-write-constructor-more-than-once-in-a-class",
      "title": "What happens if you write constructor more than once in a class",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, classes",
      "text": "### What happens if you write constructor more than once in a class?\n\nIn JavaScript, a class can only have one constructor method. If you define multiple constructors, it will result in a syntax error. However, you can simulate multiple constructors by using default parameters or using conditional logic within a single constructor.\n\nExample:\n\n```javascript\nclass Person {\n  constructor(name = 'John', age = 30) {\n    this.name = name;\n    this.age = age;\n  }\n}\nconst person = new Person();\nconsole.log(person.name); // John\n```"
    },
    {
      "link": "#what-happens-with-negating-an-array",
      "title": "What happens with negating an array",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays",
      "text": "### What happens with negating an array?\n\nWhen you negate an array in JavaScript, it is first converted to a primitive value, which is `true` when the array is non-empty and `false` when the array is empty. Negating it results in `false` for non-empty arrays and `true` for empty arrays.\n\nExample:\n\n```javascript\nlet arr = [1, 2, 3];\nconsole.log(!arr);  // Output: false\narr = [];\nconsole.log(!arr);  // Output: true\n```"
    },
    {
      "link": "#what-is-a-comma-operator",
      "title": "What is a comma operator",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, operators",
      "text": "### What is a comma operator?\n\nThe comma operator in JavaScript allows you to evaluate multiple expressions in a single statement, returning the value of the last expression. It is useful when you need to execute several operations within a single statement.\n\nExample:\n\n```javascript\nlet a = (1, 2, 3);\nconsole.log(a); // 3\n```"
    },
    {
      "link": "#what-is-a-conditional-operator-in-javascript",
      "title": "What is a conditional operator in javascript",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7457925912974216481",
      "level": "basic",
      "theme": "JavaScript, operators",
      "text": "### What is a conditional operator in javascript?\n\nThe conditional (ternary) operator is a shorthand for an `if-else` statement. It evaluates a condition and returns one of two values based on whether the condition is true or false.\n\nExample:\n\n```javascript\nconst result = (age >= 18) ? 'Adult' : 'Minor';\n```"
    },
    {
      "link": "#what-is-a-constructor-method",
      "title": "What is a constructor method",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, classes",
      "text": "### What is a constructor method?\n\nA constructor method in JavaScript is a special function within a class that is called when an instance of the class is created. It is used to initialize the object’s properties.\n\nExample:\n\n```javascript\nclass Person {\n  constructor(name, age) {\n    this.name = name;\n    this.age = age;\n  }\n}\nconst person = new Person('John', 30);\nconsole.log(person.name); // John\n```"
    },
    {
      "link": "#what-is-a-debugger-statement",
      "title": "What is a debugger statement",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7457945315644165408",
      "level": "basic",
      "theme": "JavaScript, debugging",
      "text": "### What is a debugger statement?\n\nThe `debugger` statement is used to stop the execution of JavaScript and invoke the debugging functionality of the browser. It can be used to set breakpoints during development.\n\nExample:\n\n```javascript\ndebugger;\nconsole.log('This will pause execution');\n```"
    },
    {
      "link": "#what-is-a-decorator",
      "title": "What is a decorator",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, design patterns",
      "text": "### What is a decorator?\n\nA decorator is a function that takes another function or method and adds additional functionality to it without modifying the original function. Decorators are commonly used in JavaScript to modify or enhance behavior in a reusable way.\n\nExample:\n\n```javascript\nfunction log(target, key, descriptor) {\n  const original = descriptor.value;\n  descriptor.value = function(...args) {\n    console.log('Calling ' + key);\n    return original.apply(this, args);\n  };\n  return descriptor;\n}\nclass MyClass {\n  @log\n  myMethod() {\n    console.log('Method executed');\n  }\n}\nconst obj = new MyClass();\nobj.myMethod(); // Logs: 'Calling myMethod' and 'Method executed'\n```"
    },
    {
      "link": "#what-is-a-freeze-method",
      "title": "What is a freeze method",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7457554518977285408",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### What is a freeze method?\n\nThe `Object.freeze()` method freezes an object, preventing new properties from being added, existing properties from being removed, or their values from being changed.\n\nExample:\n\n```javascript\nconst obj = { name: 'John' };\nObject.freeze(obj);\nobj.name = 'Jane'; // This won't change the name\n```"
    },
    {
      "link": "#what-is-a-microtask-queue",
      "title": "What is a microtask queue",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Event Loop",
      "text": "### What is a microtask queue?\n\nA microtask queue is a queue in JavaScript that handles microtasks, which are small asynchronous tasks. These tasks are executed after the current script finishes executing, but before any other tasks in the event loop (macrotasks) are processed.\n\nMicrotasks typically include promise handlers (`.then()`, `.catch()`) and tasks queued by `queueMicrotask()`.\n\nExample:\n\n```javascript\nPromise.resolve().then(() => console.log('Microtask executed'));"
    },
    {
      "link": "#what-is-a-polyfill",
      "title": "What is a polyfill",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456405893618437409",
      "level": "basic",
      "theme": "JavaScript, web development",
      "text": "### What is a polyfill?\n\nA polyfill is a piece of code that implements a feature in a browser that does not support it natively. It ensures compatibility with older browsers.\n\nExample: A polyfill for `Array.prototype.includes`:\n\n```javascript\nif (!Array.prototype.includes) {\n  Array.prototype.includes = function(element) {\n    return this.indexOf(element) !== -1;\n  };\n}\n```"
    },
    {
      "link": "#what-is-a-proper-tail-call",
      "title": "What is a Proper Tail Call",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Optimization",
      "text": "### What is a Proper Tail Call?\n\nA Proper Tail Call (PTC) is a feature where the last action of a function is a call to another function, and the current function's stack frame is removed before executing the called function. This optimization prevents stack overflow errors for recursive calls.\n\nExample:\n\n```javascript\nfunction factorial(n, acc = 1) {\n  if (n === 0) return acc;\n  return factorial(n - 1, acc * n);  // Tail call\n}\nconsole.log(factorial(5));  // Output: 120\n```"
    },
    {
      "link": "#what-is-a-proxy-object",
      "title": "What is a proxy object",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7458050469735320865",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### What is a proxy object?\n\nA Proxy object is used to define custom behavior for fundamental operations (e.g., property lookup, assignment, function invocation) on another object. It is used for tasks like validation, logging, or access control.\n\nExample:\n\n```javascript\nconst person = {\n  name: 'John'\n};\nconst handler = {\n  get: function(target, prop) {\n    if (prop === 'name') {\n      return 'Jane';\n    }\n    return prop;\n  }\n};\nconst proxyPerson = new Proxy(person, handler);\nconsole.log(proxyPerson.name); // 'Jane'\n```"
    },
    {
      "link": "#what-is-a-regexp-object",
      "title": "What is a RegExp object",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456579932475362592",
      "level": "basic",
      "theme": "JavaScript, regular expressions",
      "text": "### What is a RegExp object?\n\nA `RegExp` object in JavaScript is used to work with regular expressions. It provides methods like `exec()` and `test()` to search for patterns in strings.\n\nExample:\n\n```javascript\nconst regex = new RegExp('\\d+');\nconsole.log(regex.test('123')); // true\n```"
    },
    {
      "link": "#what-is-a-regular-expression",
      "title": "What is a Regular Expression",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456774238825925920",
      "level": "basic",
      "theme": "JavaScript, regular expressions",
      "text": "### What is a Regular Expression?\n\nA regular expression (regex) is a pattern used to match character combinations in strings. It is commonly used for validating input or searching for patterns.\n\nExample:\n\n```javascript\nconst regex = /\\d+/;\nconsole.log(regex.test('123')); // true\n```"
    },
    {
      "link": "#what-is-a-rest-parameter",
      "title": "What is a rest parameter",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7457471528330988832",
      "level": "basic",
      "theme": "JavaScript, functions",
      "text": "### What is a rest parameter?\n\nA rest parameter allows a function to accept an indefinite number of arguments as an array. It is denoted by `...`.\n\nExample:\n\n```javascript\nfunction sum(...numbers) {\n  return numbers.reduce((a, b) => a + b, 0);\n}\nconsole.log(sum(1, 2, 3, 4)); // 10\n```"
    },
    {
      "link": "#what-is-a-short-circuit-condition",
      "title": "What is a Short circuit condition",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Logical Operators",
      "text": "### What is a Short-circuit condition?\n\nA short-circuit condition occurs when the evaluation of a logical expression stops as soon as the result is determined. This is common with logical `AND` (`&&`) and `OR` (`||`) operators.\n\n- In an `AND` condition, if the first operand is falsy, the second operand is not evaluated.\n- In an `OR` condition, if the first operand is truthy, the second operand is not evaluated.\n\nExample:\n\n```javascript\nlet a = false;\nlet b = true;\nconsole.log(a && b);  // 'false', 'b' is not evaluated"
    },
    {
      "link": "#what-is-a-spread-operator",
      "title": "What is a spread operator",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, operators",
      "text": "### What is a spread operator?\n\nThe spread operator (`...`) is used to expand elements of an array or object. It can be used to create shallow copies or merge multiple arrays or objects.\n\nExample with arrays:\n\n```javascript\nconst arr1 = [1, 2, 3];\nconst arr2 = [...arr1, 4, 5];\nconsole.log(arr2); // [1, 2, 3, 4, 5]\n```\nExample with objects:\n\n```javascript\nconst obj1 = { name: 'John', age: 30 };\nconst obj2 = { ...obj1, city: 'New York' };\nconsole.log(obj2); // { name: 'John', age: 30, city: 'New York' }\n```"
    },
    {
      "link": "#what-is-a-thunk-function",
      "title": "What is a thunk function",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Functional Programming",
      "text": "### What is a thunk function?\n\nA thunk function is a function that wraps another function or expression, typically used to delay the execution of the original function. It is often used in functional programming to manage side effects or control execution order.\n\nExample:\n\n```javascript\nconst add = (a, b) => a + b;\nconst thunk = (a, b) => () => add(a, b);\nconst result = thunk(2, 3)();  // Output: 5\n```"
    },
    {
      "link": "#what-is-a-void-operator",
      "title": "What is a void operator",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Operators",
      "text": "### What is a void operator?\n\nThe `void` operator is used to evaluate an expression and return `undefined`. It is often used in situations where you want to execute a function or expression but do not care about its result.\n\nExample:\n\n```javascript\nvoid(0);  // Returns undefined\nvoid(console.log('Hello'));  // Logs 'Hello' and returns undefined\n```"
    },
    {
      "link": "#what-is-a-weakmap",
      "title": "What is a WeakMap",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7458221758114516256",
      "level": "basic",
      "theme": "JavaScript, collections",
      "text": "### What is a WeakMap?\n\nA `WeakMap` is a collection of key-value pairs where the keys are objects and the values can be any type. The keys in a `WeakMap` are held weakly, meaning they can be garbage collected when there are no other references to the key object.\n\nExample:\n\n```javascript\nconst obj1 = { name: 'John' };\nconst weakmap = new WeakMap();\nweakmap.set(obj1, 'value');\nconsole.log(weakmap.get(obj1)); // 'value'\n```"
    },
    {
      "link": "#what-is-a-weakset",
      "title": "What is a WeakSet",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, collections",
      "text": "### What is a WeakSet?\n\nA `WeakSet` is a collection of objects where each object is held weakly. This means the objects in a `WeakSet` are not prevented from being garbage-collected when there are no other references to them. It only accepts objects, and it does not allow duplicates.\n\nExample:\n\n```javascript\nconst obj1 = { name: 'John' };\nconst obj2 = { name: 'Jane' };\nconst weakset = new WeakSet([obj1, obj2]);\nconsole.log(weakset.has(obj1)); // true\n```"
    },
    {
      "link": "#what-is-ajax",
      "title": "What is AJAX",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, AJAX",
      "text": "### What is AJAX?\n\nAJAX (Asynchronous JavaScript and XML) is a technique for creating dynamic web pages. It allows web pages to update asynchronously by exchanging small amounts of data with the server behind the scenes.\n\nExample using `fetch`:\n\n```javascript\nfetch('https://api.example.com/data')\n  .then(response => response.json())\n  .then(data => console.log(data));\n```"
    },
    {
      "link": "#what-is-an-anonymous-function",
      "title": "What is an anonymous function",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, functions",
      "text": "### What is an anonymous function?\n\nAn anonymous function is a function that is declared without a name. It is often used as a callback or in situations where the function does not need to be referenced elsewhere.\n\nExample:\n\n```javascript\nconst greet = function() { console.log('Hello'); };\ngreet(); // 'Hello'\n```"
    },
    {
      "link": "#what-is-an-app-shell-model",
      "title": "What is an app shell model",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456136059966049568",
      "level": "basic",
      "theme": "JavaScript, web development",
      "text": "### What is an app shell model?\n\nThe app shell model is a design approach where the static structure of a web app (such as HTML, CSS, and JavaScript) is cached and loaded first, followed by dynamic content. This approach is used in Progressive Web Apps (PWAs)."
    },
    {
      "link": "#what-is-an-arguments-object",
      "title": "What is an arguments object",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7455473337897061664",
      "level": "basic",
      "theme": "JavaScript, functions",
      "text": "### What is an arguments object?\n\nThe `arguments` object is an array-like object available within all non-arrow functions. It contains the values of all arguments passed to the function.\n\n```javascript\nfunction test() {\n  console.log(arguments);\n}\ntest(1, 2, 3); // { '0': 1, '1': 2, '2': 3 }\n```"
    },
    {
      "link": "#what-is-an-async-function",
      "title": "What is an async function",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Asynchronous Programming",
      "text": "### What is an async function?\n\nAn `async` function is a function that always returns a `Promise`. It allows you to write asynchronous code using the `await` keyword, which pauses the execution until the `Promise` resolves or rejects.\n\nExample:\n\n```javascript\nasync function fetchData() {\n  let response = await fetch('https://api.example.com');\n  let data = await response.json();\n  console.log(data);\n}\nfetchData();\n```"
    },
    {
      "link": "#what-is-an-empty-statement-and-purpose-of-it",
      "title": "What is an empty statement and purpose of it",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, statements",
      "text": "### What is an empty statement and purpose of it?\n\nAn empty statement in JavaScript is a statement that does nothing. It is represented by a semicolon (`;`) on its own. Although it does not perform any action, it can be used in loops, conditionals, or in places where a statement is syntactically required.\n\nExample:\n\n```javascript\nfor (let i = 0; i < 5; i++) { ; }\n// No operation happens in the loop, but the loop is still valid\n```"
    },
    {
      "link": "#what-is-an-enum",
      "title": "What is an enum",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, TypeScript",
      "text": "### What is an enum?\n\nAn `enum` (short for 'enumeration') is a feature in programming languages like TypeScript, which allows you to define a set of named constants. Enums help in making code more readable and maintainable by giving meaningful names to values.\n\nExample in TypeScript:\n\n```typescript\nenum Color {\n  Red = 'RED',\n  Green = 'GREEN',\n  Blue = 'BLUE'\n}\nlet color: Color = Color.Red;\nconsole.log(color); // 'RED'\n```"
    },
    {
      "link": "#what-is-an-environment-record",
      "title": "What is an environment record?",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Execution Context",
      "text": "### What is an environment record?\n\nAn environment record is an internal data structure that holds variables and function declarations in a particular scope. It is part of the execution context and includes:\n\n1. **Declarative Environment Record**:\n   - Stores variables and functions declared with `var`, `let`, and `const`.\n\n2. **Object Environment Record**:\n   - Stores bindings for global objects or `with` statements.\n\nExample:\n\n```javascript\nfunction example() {\n  let a = 10; // Stored in Declarative Environment Record\n  var b = 20; // Stored in Declarative Environment Record\n}\n```"
    },
    {
      "link": "#what-is-an-error-object",
      "title": "What is an error object",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, errors",
      "text": "### What is an error object?\n\nThe `Error` object in JavaScript is used to represent runtime errors. It provides information about the error, such as its name, message, and stack trace.\n\nExample:\n\n```javascript\ntry {\n  throw new Error('Something went wrong');\n} catch (e) {\n  console.log(e.name); // 'Error'\n  console.log(e.message); // 'Something went wrong'\n}\n```"
    },
    {
      "link": "#what-is-an-event-delegation",
      "title": "What is an event delegation",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7455085016050060576",
      "level": "intermediate",
      "theme": "JavaScript, events",
      "text": "### What is an event delegation?\n\nEvent delegation is a technique where you attach a single event listener to a parent element, which handles events for its child elements. This is more efficient than adding event listeners to each child element individually."
    },
    {
      "link": "#what-is-an-event-loop",
      "title": "What is an event loop",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, concurrency model",
      "text": "### What is an event loop?\n\nThe event loop is a fundamental concept in JavaScript's concurrency model. It is responsible for executing code, handling events, and executing queued messages (tasks). The event loop continuously checks the call stack and event queue, ensuring that asynchronous tasks are executed when the call stack is empty.\n\nExample:\n\n```javascript\nconsole.log('Start');\nsetTimeout(() => console.log('Timeout'), 0);\nconsole.log('End');\n// Output: 'Start', 'End', 'Timeout'\n```"
    },
    {
      "link": "#what-is-an-event-queue",
      "title": "What is an event queue",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, concurrency model",
      "text": "### What is an event queue?\n\nThe event queue (or message queue) is a data structure that holds tasks (or events) that are waiting to be processed. When the call stack is empty, the event loop pushes the first task from the event queue onto the stack for execution.\n\nExample:\n\n```javascript\nsetTimeout(() => console.log('Event'), 0);\nconsole.log('Start');\n// Output: 'Start', 'Event'\n```"
    },
    {
      "link": "#what-is-an-event-table",
      "title": "What is an event table",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Event Loop",
      "text": "### What is an event table?\n\nAn event table is a structure used by the JavaScript engine to manage event handling. It tracks which event listeners are registered for specific events, ensuring that when an event occurs, the appropriate listener is invoked."
    },
    {
      "link": "#what-is-an-intl-object",
      "title": "What is an Intl object",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, internationalization",
      "text": "### What is an Intl object?\n\nThe `Intl` object in JavaScript provides functionality for internationalization, including methods for formatting numbers, dates, and currencies, and for comparing strings according to a specific locale.\n\nExample:\n\n```javascript\nconst number = 123456.789;\nconst formatter = new Intl.NumberFormat('en-US');\nconsole.log(formatter.format(number)); // '123,456.789'\n```"
    },
    {
      "link": "#what-is-an-iterator",
      "title": "What is an Iterator",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, iterators",
      "text": "### What is an Iterator?\n\nAn iterator is an object that provides a way to access elements of a collection (such as arrays or maps) one at a time. It conforms to the `Iterator` protocol, which includes methods like `next()`, `return()`, and `throw()`.\n\nExample:\n\n```javascript\nconst arr = [1, 2, 3];\nconst iterator = arr[Symbol.iterator]();\nconsole.log(iterator.next()); // { value: 1, done: false }\nconsole.log(iterator.next()); // { value: 2, done: false }\n```"
    },
    {
      "link": "#what-is-an-object-initializer",
      "title": "What is an object initializer",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### What is an object initializer?\n\nAn object initializer (or object literal) is a way to create and initialize an object in JavaScript. It uses curly braces `{}` and defines key-value pairs for the properties of the object.\n\nExample:\n\n```javascript\nconst person = { name: 'John', age: 30 };\nconsole.log(person.name); // John\n```"
    },
    {
      "link": "#what-is-an-observable",
      "title": "What is an observable",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, RxJS",
      "text": "### What is an observable?\n\nAn Observable is a representation of a stream of values or events that can be observed over time. Observables are the core concept in reactive programming and are widely used in libraries like RxJS to manage asynchronous operations.\n\nAn observable can emit values, complete, or throw errors.\n\nExample:\n\n```javascript\nimport { Observable } from 'rxjs';\n\nlet observable = new Observable(observer => {\n  observer.next('Hello');\n  observer.complete();\n});\nobservable.subscribe(value => console.log(value));"
    },
    {
      "link": "#what-is-an-unary-operator",
      "title": "What is an Unary operator",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, operators",
      "text": "### What is an Unary operator?\n\nAn unary operator is an operator that operates on a single operand. It performs operations like negation, increment, and decrement.\n\nExamples of unary operators include:\n\n- `+` (Unary plus)\n- `-` (Unary minus)\n- `++` (Increment)\n- `--` (Decrement)\n- `!` (Logical NOT)\n\nExample:\n\n```javascript\nlet a = 5;\nconsole.log(++a); // 6\nconsole.log(a++); // 6\nconsole.log(a); // 7\n```"
    },
    {
      "link": "#what-is-arraybuffer",
      "title": "What is ArrayBuffer",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Binary Data",
      "text": "### What is ArrayBuffer?\n\n`ArrayBuffer` is a JavaScript object used to represent a generic, fixed-length raw binary data buffer. It is typically used when working with binary data, such as file processing, network requests, or Web APIs like WebSockets.\n\nExample:\n\n```javascript\nlet buffer = new ArrayBuffer(16);  // 16 bytes buffer\nlet view = new Uint8Array(buffer);  // Typed array view\nview[0] = 255;\nconsole.log(view[0]);  // Output: 255\n```"
    },
    {
      "link": "#what-is-babel",
      "title": "What is Babel",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Tools",
      "text": "### What is Babel?\n\nBabel is a JavaScript compiler that allows you to write next-generation JavaScript code (ES6/ES7+) and transform it into code that can run on older browsers or environments. Babel can also be used to compile JSX for React applications.\n\nExample of a Babel transformation:\n\n```javascript\nlet greet = () => console.log('Hello');  // ES6 arrow function\n```"
    },
    {
      "link": "#what-is-bom",
      "title": "What is BOM",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7454626475623468320",
      "level": "intermediate",
      "theme": "JavaScript, browser",
      "text": "### What is BOM?\n\nThe Browser Object Model (BOM) allows JavaScript to interact with the browser outside of the DOM. It includes objects like `window`, `navigator`, `screen`, and `location`, enabling you to control browser-related functions."
    },
    {
      "link": "#what-is-call-stack",
      "title": "What is call stack",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, execution context",
      "text": "### What is a call stack?\n\nThe call stack is a stack data structure that stores information about the active execution context of a program. When a function is called, it is added to the stack, and when it finishes executing, it is removed from the stack.\n\nExample:\n\n```javascript\nfunction a() {\n  b();\n}\nfunction b() {\n  console.log('Hello');\n}\na();\n// Call stack will be: [a(), b()]\n```"
    },
    {
      "link": "#what-is-collation",
      "title": "What is collation",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Internationalization",
      "text": "### What is collation?\n\nCollation refers to the rules for comparing and sorting strings based on locale-specific conventions. In JavaScript, the `Intl.Collator` object is used to perform locale-sensitive string comparison and sorting.\n\nExample:\n\n```javascript\nlet collator = new Intl.Collator('en', { sensitivity: 'base' });\nlet result = collator.compare('apple', 'banana');\nconsole.log(result);  // Output: -1\n```"
    },
    {
      "link": "#what-is-debouncing",
      "title": "What is debouncing?",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Performance",
      "text": "### What is debouncing?\n\nDebouncing ensures that a function is called only after a specified time has passed since the last invocation. It is useful for optimizing performance in scenarios like input fields or resizing events.\n\nExample:\n\n```javascript\nfunction debounce(func, delay) {\n  let timer;\n  return function(...args) {\n    clearTimeout(timer);\n    timer = setTimeout(() => func.apply(this, args), delay);\n  };\n}\n\nconst log = debounce(() => console.log('Debounced!'), 300);\nwindow.addEventListener('resize', log);\n```"
    },
    {
      "link": "#what-is-deno",
      "title": "What is Deno",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Runtime",
      "text": "### What is Deno?\n\nDeno is a modern, secure runtime for JavaScript and TypeScript, built on V8 and written in Rust. It was created by Ryan Dahl, the original creator of Node.js, to address some of Node.js's design limitations.\n\nFeatures:\n- Secure by default (no file, network, or environment access without explicit permission).\n- Supports TypeScript out of the box.\n- Uses ES modules instead of CommonJS.\n\nExample:\n\n```javascript\n// Example Deno script\nconsole.log('Hello, Deno!');\n```"
    },
    {
      "link": "#what-is-destructuring-aliases",
      "title": "What is destructuring aliases",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Destructuring",
      "text": "### What is destructuring aliases?\n\nDestructuring aliases allow you to rename variables when destructuring an object or array. This is useful when the variable names in the object/array do not match your desired variable names.\n\nExample:\n\n```javascript\nlet person = { name: 'Alice', age: 25 };\nlet { name: fullName, age: yearsOld } = person;\nconsole.log(fullName);  // Output: 'Alice'\nconsole.log(yearsOld);  // Output: 25\n```"
    },
    {
      "link": "#what-is-destructuring-assignment",
      "title": "What is destructuring assignment",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Destructuring",
      "text": "### What is destructuring assignment?\n\nDestructuring assignment is a convenient way to extract values from arrays or objects and assign them to variables. It can be used with arrays, objects, and even nested structures.\n\nExample with array:\n\n```javascript\nlet [x, y] = [1, 2];\nconsole.log(x, y);  // Output: 1 2\n```\nExample with object:\n\n```javascript\nlet { name, age } = { name: 'John', age: 30 };\nconsole.log(name, age);  // Output: John 30\n```"
    },
    {
      "link": "#what-is-ecmascript",
      "title": "What is ECMAScript",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7453531864133815584",
      "level": "basic",
      "theme": "JavaScript, standards",
      "text": "### What is ECMAScript?\n\nECMAScript is the standard specification that JavaScript is based on. It defines the core features and behavior of JavaScript, and different versions of ECMAScript introduce new features to the language."
    },
    {
      "link": "#what-is-es6",
      "title": "What is ES6",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, ES6",
      "text": "### What is ES6?\n\nES6 (ECMAScript 2015) is the sixth version of the ECMAScript standard, which defines the scripting language that JavaScript is based on. ES6 introduced many new features, such as `let`, `const`, arrow functions, promises, and modules, making JavaScript more powerful and easier to work with."
    },
    {
      "link": "#what-is-event-capturing",
      "title": "What is event capturing",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7451534594895056160",
      "level": "intermediate",
      "theme": "JavaScript, events",
      "text": "### What is event capturing?\n\nEvent capturing is the process where an event is first captured by the outermost element before it reaches the target element. This is the opposite of event bubbling."
    },
    {
      "link": "#what-is-forof-statement",
      "title": "What is for...of statement",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Loops",
      "text": "### What is for...of statement?\n\nThe `for...of` statement is used to iterate over the values of iterable objects (like arrays, strings, maps, etc.) in JavaScript. It provides a simpler syntax than traditional loops and works well with iterables.\n\nExample:\n\n```javascript\nlet arr = [10, 20, 30];\nfor (let value of arr) {\n  console.log(value);\n}\n// Output: 10 20 30\n```"
    },
    {
      "link": "#what-is-function-composition",
      "title": "What is Function Composition?",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Functional Programming",
      "text": "### What is Function Composition?\n\nFunction composition is the process of combining two or more functions to produce a new function. The output of one function becomes the input of the next.\n\nExample:\n\n```javascript\nconst add = x => x + 1;\nconst multiply = x => x * 2;\n\nconst compose = (...fns) => x => fns.reduceRight((acc, fn) => fn(acc), x);\n\nconst composed = compose(multiply, add);\nconsole.log(composed(5)); // 12\n```"
    },
    {
      "link": "#what-is-function-execution-context",
      "title": "What is function execution context?",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Execution Context",
      "text": "### What is function execution context?\n\nA function execution context is created when a function is invoked. It contains:\n\n1. **`this` Binding**:\n   - Depends on how the function is called.\n\n2. **Scope Chain**:\n   - Includes variables from the function's scope and its outer lexical environments.\n\n3. **Variable Environment**:\n   - Stores function variables and parameters.\n\nExample:\n\n```javascript\nfunction example() {\n  var a = 10; // Stored in variable environment\n  console.log(this); // Depends on invocation\n}\nexample();\n```"
    },
    {
      "link": "#what-is-global-execution-context",
      "title": "What is global execution context?",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Execution Context",
      "text": "### What is global execution context?\n\nThe global execution context is the default context in which JavaScript code runs. It is created when a JavaScript file is executed and contains:\n\n1. **Global Object**:\n   - In browsers, this is the `window` object.\n\n2. **`this` Keyword**:\n   - Refers to the global object in non-strict mode.\n\n3. **Global Variables and Functions**:\n   - All declared variables and functions at the top level.\n\nExample:\n\n```javascript\nconsole.log(this); // window in browsers\nvar a = 10; // Part of global execution context\n```"
    },
    {
      "link": "#what-is-globalthis-and-what-is-the-importance-of-it",
      "title": "What is globalThis, and what is the importance of it?",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Global Objects",
      "text": "### What is `globalThis`, and what is the importance of it?\n\n`globalThis` provides a standard way to access the global object across different environments (browser, Node.js, etc.).\n\n#### Key Points:\n1. **Universal Access:**\n   - Replaces environment-specific global objects like `window`, `global`, or `self`.\n\n2. **Example:**\n   ```javascript\n   console.log(globalThis); // In browsers, equivalent to window.\n   ```"
    },
    {
      "link": "#what-is-heap",
      "title": "What is heap",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Memory",
      "text": "### What is heap?\n\nThe heap is a region of memory used for dynamic memory allocation in JavaScript. It is used for storing objects and arrays, and its size can grow or shrink during program execution.\n\nWhen an object is created, it is stored in the heap, while primitive types are stored in the stack."
    },
    {
      "link": "#what-is-inline-caching",
      "title": "What is inline caching?",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, V8 Engine",
      "text": "### What is inline caching?\n\nInline caching is a JavaScript engine optimization technique that speeds up property access by caching the results of previous lookups.\n\n#### Key Points:\n1. **Purpose:**\n   - Reduce the overhead of repeatedly resolving the same property or method on an object.\n\n2. **How It Works:**\n   - During the first lookup, the engine determines the property location and caches it.\n   - On subsequent accesses, the engine uses the cached result, bypassing the need for lookup.\n\nExample:\n```javascript\nfunction add(a, b) {\n  return a.value + b.value;\n}\n\nconst obj1 = { value: 10 };\nconst obj2 = { value: 20 };\n\nconsole.log(add(obj1, obj2)); // Inline caching optimizes property access.\n```"
    },
    {
      "link": "#what-is-jquery",
      "title": "What is jQuery",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, libraries",
      "text": "### What is jQuery?\n\njQuery is a fast, small, and feature-rich JavaScript library. It simplifies tasks such as DOM manipulation, event handling, animation, and Ajax requests. It provides a simple API that works across all browsers.\n\nExample:\n\n```javascript\n$(document).ready(function() {\n  $('#myElement').hide();\n});\n```"
    },
    {
      "link": "#what-is-json",
      "title": "What is JSON",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456025885263629601",
      "level": "basic",
      "theme": "JavaScript, data formats",
      "text": "### What is JSON?\n\nJSON (JavaScript Object Notation) is a lightweight data-interchange format that is easy for humans to read and write, and easy for machines to parse and generate. It is often used to exchange data between a client and server."
    },
    {
      "link": "#what-is-lexical-scope",
      "title": "What is Lexical Scope?",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Scope",
      "text": "### What is Lexical Scope?\n\nLexical scope refers to the scope determined by the physical structure of the code. It is defined at compile time and based on where variables and functions are declared.\n\n#### Key Points:\n1. **Inner Functions:**\n   - Inner functions can access variables declared in their outer scope.\n\n2. **Compile-Time Binding:**\n   - Scope is determined when the code is written, not during execution.\n\nExample:\n```javascript\nfunction outer() {\n  const outerVar = 'I am outer';\n\n  function inner() {\n    console.log(outerVar); // Accessible due to lexical scope.\n  }\n\n  inner();\n}\n\nouter();\n```"
    },
    {
      "link": "#what-is-mean-in-javascript",
      "title": "What is MEAN in JavaScript",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, frameworks",
      "text": "### What is MEAN in JavaScript?\n\nMEAN is an acronym for a stack of technologies used for building web applications:\n- **MongoDB**: A NoSQL database.\n- **Express.js**: A web application framework for Node.js.\n- **Angular**: A front-end framework for building single-page applications.\n- **Node.js**: A runtime environment for executing JavaScript on the server-side.\n\nThe MEAN stack provides a full-stack JavaScript solution for both client-side and server-side development."
    },
    {
      "link": "#what-is-microtask",
      "title": "What is microtask",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Event Loop",
      "text": "### What is a microtask?\n\nA microtask is a type of task that is executed after the currently executing script, but before the next task is processed. Microtasks are typically used for promises and other asynchronous operations.\n\nMicrotasks are executed after the current task completes, but before the rendering or other macrotasks are handled.\n\nExample of a microtask:\n\n```javascript\nPromise.resolve().then(() => console.log('Microtask executed'));"
    },
    {
      "link": "#what-is-minification",
      "title": "What is Minification",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, optimization",
      "text": "### What is Minification?\n\nMinification is the process of removing unnecessary characters from JavaScript code, such as whitespace, comments, and newline characters, without affecting the functionality of the code. This is done to reduce the file size and improve the performance of web applications by decreasing load times.\n\nExample:\n\n```javascript\n// Original Code\nfunction sum(a, b) {\n  return a + b;\n}\n\n// Minified Code\nfunction sum(a,b){return a+b;}\n```"
    },
    {
      "link": "#what-is-minimum-timeout-throttling",
      "title": "What is minimum timeout throttling",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Performance",
      "text": "### What is minimum timeout throttling?\n\nMinimum timeout throttling refers to the browser's behavior of enforcing a minimum delay for `setTimeout` and `setInterval` calls. This is done to avoid excessive resource consumption, especially in high-frequency scenarios like animations or polling.\n\nFor example, in modern browsers, the minimum delay is typically 4ms for background tabs and 0ms for the active tab.\n\n```javascript\nsetTimeout(() => console.log('Executed after delay'), 0);\n```"
    },
    {
      "link": "#what-is-module-pattern",
      "title": "What is module pattern?",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Design Patterns",
      "text": "### What is the Module Pattern?\n\nThe Module Pattern is a design pattern used to encapsulate private and public variables and methods. It provides a way to create a namespace and control access to certain parts of code.\n\nExample:\n\n```javascript\nconst myModule = (function() {\n  let privateVar = 'I am private';\n\n  function privateMethod() {\n    console.log(privateVar);\n  }\n\n  return {\n    publicMethod: function() {\n      privateMethod();\n    }\n  };\n})();\n\nmyModule.publicMethod(); // 'I am private'\nconsole.log(myModule.privateVar); // undefined\n```"
    },
    {
      "link": "#what-is-nodejs",
      "title": "What is nodejs",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, runtime",
      "text": "### What is Node.js?\n\nNode.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. It allows developers to run JavaScript code outside of a browser, typically for building server-side applications.\n\nExample:\n\n```javascript\n// A simple Node.js server\nconst http = require('http');\nconst server = http.createServer((req, res) => {\n  res.write('Hello, world!');\n  res.end();\n});\nserver.listen(3000);\n```"
    },
    {
      "link": "#what-is-nullish-coalescing-operator-",
      "title": "What is nullish coalescing operator (??)?",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Operators",
      "text": "### What is nullish coalescing operator (??)?\n\nThe `??` operator returns the right-hand operand if the left-hand operand is `null` or `undefined`. It is useful for providing default values.\n\nExample:\n\n```javascript\nconst value = null;\nconsole.log(value ?? 'default'); // Output: 'default'\n\nconst number = 0;\nconsole.log(number ?? 42); // Output: 0\n```"
    },
    {
      "link": "#what-is-obfuscation-in-javascript",
      "title": "What Is Obfuscation in JavaScript",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, security",
      "text": "### What Is Obfuscation in JavaScript?\n\nObfuscation in JavaScript refers to the process of making code difficult to understand or read by humans. This is typically done to protect the code from reverse engineering or tampering. It involves techniques like renaming variables and functions to meaningless names, removing whitespace, and making the code less readable.\n\nExample:\n\n```javascript\n// Original Code\nfunction add(a, b) { return a + b; }\n\n// Obfuscated Code\nvar _0x1234 = function(_0x5678, _0x9abc) { return _0x5678 + _0x9abc; };\n```"
    },
    {
      "link": "#what-is-optional-chaining",
      "title": "What is optional chaining?",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Operators",
      "text": "### What is optional chaining?\n\nThe optional chaining operator (`?.`) allows safe access to deeply nested object properties without worrying about `null` or `undefined` errors.\n\nExample:\n\n```javascript\nconst user = { profile: { name: 'Alice' } };\nconsole.log(user.profile?.name); // 'Alice'\nconsole.log(user.address?.street); // undefined\n```"
    },
    {
      "link": "#what-is-pass-by-value-and-pass-by-reference",
      "title": "What is pass by value and pass by reference?",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Memory Management",
      "text": "### What is pass by value and pass by reference?\n\nIn JavaScript:\n\n1. **Pass by Value**:\n   - For **primitives** (e.g., numbers, strings), the value is copied.\n   - Changes to the copied variable do not affect the original.\n\n2. **Pass by Reference**:\n   - For **objects and arrays**, a reference to the memory location is passed.\n   - Changes to the reference affect the original object.\n\nExample:\n\n```javascript\nlet x = 10; // Primitive\nlet y = x;\ny = 20;\nconsole.log(x); // 10 (pass by value)\n\nlet obj1 = { key: 'value' }; // Non-primitive\nlet obj2 = obj1;\nobj2.key = 'newValue';\nconsole.log(obj1.key); // 'newValue' (pass by reference)\n```"
    },
    {
      "link": "#what-is-referential-transparency",
      "title": "What is referential transparency?",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Functional Programming",
      "text": "### What is referential transparency?\n\nA function is referentially transparent if it can be replaced with its output value without changing the program's behavior. It is a key property of pure functions.\n\nExample:\n\n```javascript\n// Referentially Transparent\nfunction add(a, b) {\n  return a + b;\n}\n\nconst result = add(2, 3); // Can replace 'add(2, 3)' with 5\nconsole.log(result); // 5\n\n// Not Referentially Transparent\nlet count = 0;\nfunction increment() {\n  return ++count;\n}\n```"
    },
    {
      "link": "#what-is-rxjs",
      "title": "What is RxJS",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, RxJS",
      "text": "### What is RxJS?\n\nRxJS (Reactive Extensions for JavaScript) is a library for reactive programming using Observables. It enables you to compose asynchronous and event-based programs using operators like `map`, `filter`, `merge`, and more.\n\nRxJS allows you to work with streams of data in a declarative manner, making it easier to manage complex asynchronous flows.\n\nExample:\n\n```javascript\nimport { from } from 'rxjs';\nfrom([1, 2, 3]).subscribe(x => console.log(x));\n```"
    },
    {
      "link": "#what-is-same-origin-policy",
      "title": "What is same-origin policy",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7454519704300948768",
      "level": "intermediate",
      "theme": "JavaScript, security",
      "text": "### What is same-origin policy?\n\nThe same-origin policy is a security measure that restricts how a document or script loaded from one origin can interact with resources from another origin."
    },
    {
      "link": "#what-is-the-advantage-of-a-comma-operator",
      "title": "What is the advantage of a comma operator",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, operators",
      "text": "### What is the advantage of a comma operator?\n\nThe comma operator allows you to evaluate multiple expressions and return the result of the last one, all within a single statement. This can help in certain cases where you want to write concise code, especially in loops or complex expressions.\n\nExample:\n\n```javascript\nlet x = (a = 1, b = 2, a + b);\nconsole.log(x); // 3\n```"
    },
    {
      "link": "#what-is-the-difference-between-a-parameter-and-an-argument",
      "title": "What is the difference between a parameter and an argument",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Functions",
      "text": "### What is the difference between a parameter and an argument?\n\nA parameter is a variable defined in the function definition, while an argument is the actual value passed to the function when it is called.\n\nExample:\n\n```javascript\nfunction greet(name) {  // 'name' is the parameter\n  console.log('Hello ' + name);\n}\ngreet('John');  // 'John' is the argument\n```"
    },
    {
      "link": "#what-is-the-difference-between-an-attribute-and-a-property",
      "title": "What is the difference between an attribute and a property",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7453198212661382432",
      "level": "basic",
      "theme": "JavaScript, DOM",
      "text": "### What is the difference between an attribute and a property?\n\nAn attribute is a value set in the HTML (e.g., `src` in an `img` tag), while a property is a value associated with the element in JavaScript (e.g., `element.src`)."
    },
    {
      "link": "#what-is-the-difference-between-dense-and-sparse-arrays",
      "title": "What is the difference between dense and sparse arrays?",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays",
      "text": "### What is the difference between dense and sparse arrays?\n\n- **Dense Arrays**:\n  - All indices have elements assigned.\n  - Example:\n    ```javascript\n    const denseArray = [1, 2, 3];\n    console.log(denseArray.length); // 3\n    ```\n\n- **Sparse Arrays**:\n  - Some indices are missing (unassigned).\n  - Example:\n    ```javascript\n    const sparseArray = [1, , 3];\n    console.log(sparseArray.length); // 3\n    console.log(sparseArray[1]); // undefined\n    ```"
    },
    {
      "link": "#what-is-the-difference-between-document-load-and-domcontentloaded-events",
      "title": "What is the difference between document load and DOMContentLoaded events",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7451559472939437344",
      "level": "intermediate",
      "theme": "JavaScript, events",
      "text": "### What is the difference between document load and DOMContentLoaded events?\n\nThe `DOMContentLoaded` event fires when the HTML is completely loaded and parsed, while the `load` event waits for all resources (including images and stylesheets) to load."
    },
    {
      "link": "#what-is-the-difference-between-function-and-class-declarations",
      "title": "What is the difference between function and class declarations",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Declarations",
      "text": "### What is the difference between function and class declarations?\n\n- **Function Declarations**:\n  - Can be hoisted, meaning they can be used before they are declared in the code.\n  - Syntax: `function functionName() {}`\n\n- **Class Declarations**:\n  - Cannot be hoisted, so they must be declared before use.\n  - Syntax: `class ClassName {}`\n\nExample:\n\n```javascript\nconsole.log(foo()); // Works because of hoisting\nfunction foo() { return 'Hello'; }\n\n// console.log(new Bar()); // Error: Bar is not defined\nclass Bar { constructor() { console.log('Bar created'); } }\n```"
    },
    {
      "link": "#what-is-the-difference-between-function-constructor-and-function-declaration",
      "title": "What is the difference between Function constructor and function declaration",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Functions",
      "text": "### What is the difference between Function constructor and function declaration?\n\n- **Function Declaration**: A function declared using the `function` keyword and is hoisted, meaning it is available throughout the scope.\n\n```javascript\nfunction greet() { console.log('Hello'); }\n```\n\n- **Function Constructor**: A function created using the `Function` constructor. This approach is less commonly used and has a few limitations, such as not allowing for closures.\n\n```javascript\nlet greet = new Function('console.log(\"Hello\")');\n```"
    },
    {
      "link": "#what-is-the-difference-between-get-and-defineproperty",
      "title": "What is the difference between get and defineProperty",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### What is the difference between get and defineProperty?\n\n- `get` is used to define a getter method that returns the value of a property when accessed.\n- `Object.defineProperty()` allows you to define or modify a property directly on an object, including setting getters, setters, or other property attributes.\n\nExample:\n\n```javascript\nconst person = {\n  firstName: 'John',\n  lastName: 'Doe',\n  get fullName() { return this.firstName + ' ' + this.lastName; }\n};\nconsole.log(person.fullName); // 'John Doe'\n```"
    },
    {
      "link": "#what-is-the-difference-between-internal-and-external-javascript",
      "title": "What is the difference between internal and external javascript",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Script Tag",
      "text": "### What is the difference between internal and external JavaScript?\n\nInternal JavaScript is written directly inside the `<script>` tag within an HTML document, while external JavaScript is placed in a separate `.js` file that is linked to the HTML using the `src` attribute.\n\nExample of internal JavaScript:\n\n```html\n<script>\n  console.log('Internal JS');\n</script>\n```\nExample of external JavaScript:\n\n```html\n<script src='script.js'></script>\n```"
    },
    {
      "link": "#what-is-the-difference-between-isnan-and-numberisnan",
      "title": "What is the difference between isNaN and Number.isNaN?",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Numbers",
      "text": "### What is the difference between isNaN and Number.isNaN?\n\n- **`isNaN`**:\n  - Converts the input to a number and checks if it's `NaN`.\n  - May give misleading results for non-number inputs.\n\n- **`Number.isNaN`**:\n  - Checks strictly if the value is `NaN`.\n  - Doesn't coerce the input.\n\nExample:\n\n```javascript\nconsole.log(isNaN('hello')); // true (coerced to NaN)\nconsole.log(Number.isNaN('hello')); // false (strict check)\n```"
    },
    {
      "link": "#what-is-the-difference-between-java-and-javascript",
      "title": "What is the difference between Java and JavaScript",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, comparison",
      "text": "### What is the difference between Java and JavaScript?\n\nJava and JavaScript are two distinct programming languages with different use cases:\n\n- **Java**: A statically typed, object-oriented language mainly used for backend development, mobile apps (Android), and enterprise-level applications.\n- **JavaScript**: A dynamically typed, interpreted language used for frontend development to create interactive web pages and dynamic content.\n\nDespite the similar names, they are unrelated in terms of syntax and functionality."
    },
    {
      "link": "#what-is-the-difference-between-map-and-foreach-functions",
      "title": "What is the difference between map and forEach functions?",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Array Methods",
      "text": "### What is the difference between `map` and `forEach` functions?\n\n1. **Return Value:**\n   - `map` returns a new array with the results of the callback function.\n   - `forEach` does not return anything (undefined).\n\n2. **Purpose:**\n   - `map` is used when you want to transform each element in an array.\n   - `forEach` is used when you want to perform side effects like logging or updating an external variable.\n\nExample:\n```javascript\nconst numbers = [1, 2, 3];\n\n// map\nconst doubled = numbers.map(num => num * 2);\nconsole.log(doubled); // [2, 4, 6]\n\n// forEach\nnumbers.forEach(num => console.log(num * 2)); // Logs: 2, 4, 6\n```"
    },
    {
      "link": "#what-is-the-difference-between-native-host-and-user-objects",
      "title": "What is the difference between native, host and user objects",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7451546871723576608",
      "level": "advanced",
      "theme": "JavaScript, objects",
      "text": "### What is the difference between native, host and user objects?\n\nNative objects are built-in objects like `Object` and `Array`. Host objects are provided by the environment (e.g., browser or Node.js), like `window` or `document`. User objects are those defined by the developer."
    },
    {
      "link": "#what-is-the-difference-between-proto-and-prototype",
      "title": "What is the difference between proto and prototype",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### What is the difference between proto and prototype?\n\n`proto` is an internal property (or link) to the object's prototype, while `prototype` is a property of functions (used to create new objects) that defines methods and properties shared by all instances.\n\nExample:\n\n```javascript\nfunction Person(name) {\n  this.name = name;\n}\nPerson.prototype.greet = function() {\n  console.log('Hello ' + this.name);\n};\n```"
    },
    {
      "link": "#what-is-the-difference-between-reflow-and-repaint",
      "title": "What is the difference between reflow and repaint",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Performance",
      "text": "### What is the difference between reflow and repaint?\n\nReflow is the process where the browser recalculates the layout of the page, whereas repaint only redraws elements that have changed visually, without affecting the layout.\n\nExample:\n\n```javascript\n// Reflow happens when you modify layout-affecting properties like width/height\ndocument.body.style.width = '500px';  // Triggers reflow\n\n// Repaint happens when you modify visual properties like background-color\ndocument.body.style.backgroundColor = 'red';  // Triggers repaint\n```"
    },
    {
      "link": "#what-is-the-difference-between-settimeout-setimmediate-and-processnexttick",
      "title": "What is the difference between setTimeout, setImmediate and process.nextTick?",
      "url": "",
      "level": "advanced",
      "theme": "Node.js, Timers",
      "text": "### What is the difference between setTimeout, setImmediate and process.nextTick?\n\n1. **`setTimeout`**:\n   - Executes code after a minimum delay.\n   - Example:\n     ```javascript\n     setTimeout(() => console.log('Timeout'), 0);\n     ```\n\n2. **`setImmediate`**:\n   - Executes code after the current event loop cycle.\n   - Example:\n     ```javascript\n     setImmediate(() => console.log('Immediate'));\n     ```\n\n3. **`process.nextTick`**:\n   - Executes code before the next event loop iteration.\n   - Example:\n     ```javascript\n     process.nextTick(() => console.log('Next Tick'));\n     ```"
    },
    {
      "link": "#what-is-the-difference-between-shallow-and-deep-copy",
      "title": "What is the difference between Shallow and Deep copy",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Objects",
      "text": "### What is the difference between Shallow and Deep copy?\n\nA shallow copy copies only the top-level properties of an object or array, meaning nested objects or arrays are shared. A deep copy copies all properties, including nested ones, so that no references to the original object exist.\n\nExample of shallow copy:\n\n```javascript\nlet arr = [1, [2, 3]];\nlet shallowCopy = arr.slice();\nshallowCopy[1][0] = 99;\nconsole.log(arr);  // Output: [1, [99, 3]]\n```\n\nExample of deep copy (using `JSON.parse()` and `JSON.stringify()`):\n\n```javascript\nlet deepCopy = JSON.parse(JSON.stringify(arr));\ndeepCopy[1][0] = 100;\nconsole.log(arr);  // Output: [1, [99, 3]]\nconsole.log(deepCopy);  // Output: [1, [100, 3]]\n```"
    },
    {
      "link": "#what-is-the-difference-between-shim-and-polyfill",
      "title": "What is the difference between shim and polyfill",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Compatibility",
      "text": "### What is the difference between shim and polyfill?\n\n- **Shim**: A shim is a piece of code that provides functionality that is not natively supported in certain environments. It can add support for missing features, but does not necessarily match the specification exactly.\n\n- **Polyfill**: A polyfill is a more complete implementation of a feature that mimics the behavior of a native feature. It aims to fill in the gaps where the feature is not supported by older browsers or environments.\n\nExample of a polyfill for `Array.prototype.includes`:\n\n```javascript\nif (!Array.prototype.includes) {\n  Array.prototype.includes = function(value) {\n    return this.indexOf(value) !== -1;\n  };\n}\n```"
    },
    {
      "link": "#what-is-the-difference-between-substring-and-substr-methods",
      "title": "What is the difference between substring and substr methods?",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, String Methods",
      "text": "### What is the difference between `substring` and `substr` methods?\n\n1. **`substring(start, end)`:**\n   - Extracts characters between `start` and `end` (exclusive).\n\n2. **`substr(start, length)`:**\n   - Extracts characters starting at `start` and spanning `length` characters.\n\nExample:\n```javascript\nconst str = 'JavaScript';\n\nconsole.log(str.substring(0, 4)); // 'Java'\nconsole.log(str.substr(0, 4));    // 'Java'\n```"
    },
    {
      "link": "#what-is-the-difference-between-uneval-and-eval",
      "title": "What is the difference between uneval and eval",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, eval",
      "text": "### What is the difference between uneval and eval?\n\n- `eval()` executes a string of JavaScript code as if it were a part of the script.\n- `uneval()` (deprecated) was used to return a string representation of an object, similar to `JSON.stringify()`.\n\nExample:\n\n```javascript\nconst code = 'console.log(\"Hello\")';\neval(code); // Executes code\n```"
    },
    {
      "link": "#what-is-the-easiest-multi-condition-checking",
      "title": "What is the easiest multi-condition checking",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Conditionals",
      "text": "### What is the easiest multi-condition checking?\n\nThe easiest way to check multiple conditions is by using logical operators like `&&` (AND) or `||` (OR).\n\nExample using `&&` (AND):\n\n```javascript\nlet x = 5, y = 10;\nif (x > 0 && y > 5) {\n  console.log('Both conditions are true');\n}\n```\nExample using `||` (OR):\n\n```javascript\nlet x = 5, y = 2;\nif (x > 0 || y > 5) {\n  console.log('At least one condition is true');\n}\n```"
    },
    {
      "link": "#what-is-the-easiest-way-to-convert-an-array-to-an-object",
      "title": "What is the easiest way to convert an array to an object",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays",
      "text": "### What is the easiest way to convert an array to an object?\n\nYou can use `reduce()` to convert an array into an object, where each element becomes a key-value pair.\n\nExample:\n\n```javascript\nlet arr = ['apple', 'banana', 'cherry'];\nlet obj = arr.reduce((acc, curr, index) => {\n  acc[index] = curr;\n  return acc;\n}, {});\nconsole.log(obj);  // Output: { 0: 'apple', 1: 'banana', 2: 'cherry' }\n```"
    },
    {
      "link": "#what-is-the-easiest-way-to-ignore-promise-errors",
      "title": "What is the easiest way to ignore promise errors?",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Promises",
      "text": "### What is the easiest way to ignore promise errors?\n\nTo ignore promise errors, you can attach an empty `catch` block to the promise chain:\n\n```javascript\nfetch('invalid-url')\n  .then(response => response.json())\n  .catch(() => {}); // Errors are ignored here\n```\n\nAlternatively, use `try...catch` in an `async` function and leave the `catch` block empty:\n\n```javascript\nasync function fetchData() {\n  try {\n    const response = await fetch('invalid-url');\n  } catch {}\n}\n```"
    },
    {
      "link": "#what-is-the-easiest-way-to-resize-an-array",
      "title": "What is the easiest way to resize an array",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Arrays",
      "text": "### What is the easiest way to resize an array?\n\nThe easiest way to resize an array is by using the `length` property. You can truncate the array or expand it by setting its length.\n\nExample:\n\n```javascript\nlet arr = [1, 2, 3];\narr.length = 2;  // Truncate the array\nconsole.log(arr);  // Output: [1, 2]\narr.length = 5;  // Expand the array\nconsole.log(arr);  // Output: [1, 2, <3 empty slots>]"
    },
    {
      "link": "#what-is-the-main-difference-between-objectvalues-and-objectentries-method",
      "title": "What is the main difference between Object.values and Object.entries method",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7458282098579737889",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### What is the main difference between Object.values and Object.entries method?\n\n- `Object.values()` returns an array of the object's values.\n- `Object.entries()` returns an array of key-value pairs.\n\nExample:\n\n```javascript\nconst person = { name: 'John', age: 30 };\nconsole.log(Object.values(person)); // ['John', 30]\nconsole.log(Object.entries(person)); // [['name', 'John'], ['age', 30]]\n```"
    },
    {
      "link": "#what-is-the-need-of-tree-shaking",
      "title": "What is the need of tree shaking",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456574498947599648",
      "level": "basic",
      "theme": "JavaScript, optimization",
      "text": "### What is the need of tree shaking?\n\nTree shaking is necessary to eliminate dead code, improve the performance of web applications, and reduce the size of JavaScript bundles, leading to faster load times and better user experiences."
    },
    {
      "link": "#what-is-the-output-of-below-console-statement-with-unary-operator",
      "title": "What is the output of below console statement with unary operator",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Operators",
      "text": "### What is the output of below console statement with unary operator?\n\nThe unary operator can perform various operations such as negation, increment, and others. It operates on a single operand.\n\nExample:\n\n```javascript\nlet num = '5';\nconsole.log(+num);  // Output: 5\n```"
    },
    {
      "link": "#what-is-the-output-of-below-function-calls",
      "title": "What is the output of below function calls",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Functions",
      "text": "### What is the output of below function calls?\n\nThis type of question tests your understanding of function execution, scope, and closures in JavaScript.\n\nExample:\n\n```javascript\nfunction foo() {\n  return 'Hello, World!';\n}\nconsole.log(foo());  // Output: 'Hello, World!'\n```"
    },
    {
      "link": "#what-is-the-output-of-below-spread-operator-array",
      "title": "What is the output of below spread operator array",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7457941742650789152",
      "level": "intermediate",
      "theme": "JavaScript, Spread Operator",
      "text": "### What is the output of below spread operator array?\n\nThe spread operator (`...`) allows you to expand elements of an array into individual elements. It can be used to clone an array, combine arrays, or pass array elements as function arguments.\n\nExample:\n\n```javascript\nlet arr1 = [1, 2, 3];\nlet arr2 = [...arr1, 4, 5];\nconsole.log(arr2);  // Output: [1, 2, 3, 4, 5]\n```"
    },
    {
      "link": "#what-is-the-output-of-below-string-expression",
      "title": "What is the output of below string expression",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, String Manipulation",
      "text": "### What is the output of below string expression?\n\nThe output of a string expression depends on the specific operation being performed. For example, concatenation, trimming, or other string manipulations will yield different results.\n\nExample:\n\n```javascript\nlet str = 'Hello' + ' ' + 'World';\nconsole.log(str);  // Output: 'Hello World'\n```"
    },
    {
      "link": "#what-is-the-output-of-prepend-additive-operator-on-falsy-values",
      "title": "What is the output of prepend additive operator on falsy values",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Operators",
      "text": "### What is the output of prepend additive operator on falsy values?\n\nThe `+` operator is used to convert values to strings. When you use it with falsy values like `false`, `0`, `null`, `undefined`, or `NaN`, the result will be their string representation.\n\nExample:\n\n```javascript\nconsole.log(+false);  // Output: 0\nconsole.log(+0);  // Output: 0\nconsole.log(+null);  // Output: 0\nconsole.log(+undefined);  // Output: NaN\nconsole.log(+NaN);  // Output: NaN\n```"
    },
    {
      "link": "#what-is-the-output-of-the-following-for-loops",
      "title": "What is the output of the following for loops",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Loops",
      "text": "### What is the output of the following for loops?\n\nHere’s an example of a loop in JavaScript and its output:\n\n```javascript\nfor (let i = 0; i < 3; i++) {\n  console.log(i);\n}\n```\n\n**Output**:\n\n```\n0\n1\n2\n```"
    },
    {
      "link": "#what-is-the-precedence-order-between-local-and-global-variables",
      "title": "What is the precedence order between local and global variables",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, variables",
      "text": "### What is the precedence order between local and global variables?\n\nIn JavaScript, when a variable is declared both globally and locally, the local variable takes precedence over the global variable within the function scope.\n\nExample:\n\n```javascript\nlet name = 'Global';\nfunction greet() {\n  let name = 'Local';\n  console.log(name); // 'Local'\n}\ngreet();\nconsole.log(name); // 'Global'\n```"
    },
    {
      "link": "#what-is-the-purpose-json-stringify",
      "title": "What is the purpose JSON stringify",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7458382016141200673",
      "level": "basic",
      "theme": "JavaScript, data formats",
      "text": "### What is the purpose of JSON.stringify?\n\n`JSON.stringify()` is used to convert a JavaScript object into a JSON string, which can be sent to a server or stored for later use."
    },
    {
      "link": "#what-is-the-purpose-of-breakpoints-in-debugging",
      "title": "What is the purpose of breakpoints in debugging",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7457249779840486688",
      "level": "basic",
      "theme": "JavaScript, debugging",
      "text": "### What is the purpose of breakpoints in debugging?\n\nBreakpoints are used in debugging to pause the execution of JavaScript at a specific point. This allows you to inspect variables, control flow, and diagnose issues.\n\nExample: You can set a breakpoint in the browser's developer tools to pause execution at a specific line."
    },
    {
      "link": "#what-is-the-purpose-of-clearinterval-method",
      "title": "What is the purpose of clearInterval method",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7457687525340089633",
      "level": "basic",
      "theme": "JavaScript, timing",
      "text": "### What is the purpose of clearInterval method?\n\nThe `clearInterval()` method is used to cancel a timeout set by `setInterval()`. It stops the function from being called repeatedly after the specified interval."
    },
    {
      "link": "#what-is-the-purpose-of-cleartimeout-method",
      "title": "What is the purpose of clearTimeout method",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7453583130859949344",
      "level": "basic",
      "theme": "JavaScript, timing",
      "text": "### What is the purpose of clearTimeout method?\n\nThe `clearTimeout()` method is used to cancel a timeout that was previously established by calling `setTimeout()`. It prevents the function from being executed after the specified delay."
    },
    {
      "link": "#what-is-the-purpose-of-comparefunction-while-sorting-arrays",
      "title": "What is the purpose of compareFunction while sorting arrays",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, arrays",
      "text": "### What is the purpose of compareFunction while sorting arrays?\n\nThe `compareFunction` in the `sort()` method allows you to define custom sorting logic. By default, `sort()` converts elements to strings and sorts them lexicographically. The `compareFunction` allows you to specify how the elements should be compared, typically using numerical comparison.\n\nExample:\n\n```javascript\nconst arr = [3, 1, 2];\narr.sort((a, b) => a - b);\nconsole.log(arr); // [1, 2, 3]\n```"
    },
    {
      "link": "#what-is-the-purpose-of-dir-method-of-console-object",
      "title": "What is the purpose of dir method of console object",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Console",
      "text": "### What is the purpose of dir method of console object?\n\nThe `console.dir()` method is used to display an interactive list of the properties of a specified JavaScript object. It is especially useful for inspecting DOM elements or complex objects.\n\nExample:\n\n```javascript\nlet obj = { name: 'Alice', age: 25 };\nconsole.dir(obj);\n```"
    },
    {
      "link": "#what-is-the-purpose-of-double-tilde-operator",
      "title": "What is the purpose of double tilde operator",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Operators",
      "text": "### What is the purpose of double tilde operator?\n\nThe double tilde (`~~`) is a shorthand for converting a number to an integer by applying a bitwise NOT operation twice. It works by discarding the decimal part of the number, effectively performing a floor operation for positive numbers and ceiling for negative numbers.\n\nExample:\n\n```javascript\nlet num = 4.7;\nconsole.log(~~num);  // Output: 4\n```"
    },
    {
      "link": "#what-is-the-purpose-of-error-object",
      "title": "What is the purpose of Error object",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Error Handling",
      "text": "### What is the purpose of Error object?\n\nThe `Error` object in JavaScript is used to represent runtime errors in the application. It provides a stack trace and error message, helping developers diagnose issues. You can create custom error objects by extending the `Error` class.\n\nExample:\n\n```javascript\ntry {\n  throw new Error('Something went wrong');\n} catch (e) {\n  console.log(e.message);  // Output: Something went wrong\n}\n```"
    },
    {
      "link": "#what-is-the-purpose-of-evalerror-object",
      "title": "What is the purpose of EvalError object",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Error Handling",
      "text": "### What is the purpose of EvalError object?\n\n`EvalError` is an error object that is thrown when an issue occurs with the `eval()` function. It is rarely used today as `eval()` is generally avoided due to security concerns. The `EvalError` object provides information about errors related to code evaluation.\n\nExample:\n\n```javascript\ntry {\n  throw new EvalError('Eval error');\n} catch (e) {\n  console.log(e.message);  // Output: Eval error\n}\n```"
    },
    {
      "link": "#what-is-the-purpose-of-exec-method",
      "title": "What is the purpose of exec method",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456816176019082529",
      "level": "basic",
      "theme": "JavaScript, regular expressions",
      "text": "### What is the purpose of exec method?\n\nThe `exec()` method executes a search for a match in a string. It returns an array of matches, or `null` if no match is found.\n\nExample:\n\n```javascript\nconst regex = /\\d+/;\nconsole.log(regex.exec('abc123')); // ['123']\n```"
    },
    {
      "link": "#what-is-the-purpose-of-freeze-method",
      "title": "What is the purpose of freeze method",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### What is the purpose of freeze method?\n\nThe purpose of `Object.freeze()` is to make an object immutable. Once an object is frozen, you cannot alter its properties or add new ones, ensuring the integrity of the data.\n\nExample:\n\n```javascript\nconst obj = { key: 'value' };\nObject.freeze(obj);\nobj.key = 'new value'; // Won't work\n```"
    },
    {
      "link": "#what-is-the-purpose-of-queuemicrotask",
      "title": "What is the purpose of queueMicrotask",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Event Loop",
      "text": "### What is the purpose of `queueMicrotask`?\n\nThe `queueMicrotask()` method is used to add a microtask to the event loop queue. It is similar to using a promise but ensures that the task will be executed as soon as the current task completes, before any rendering or other tasks.\n\nExample:\n\n```javascript\nqueueMicrotask(() => console.log('Microtask executed'));"
    },
    {
      "link": "#what-is-the-purpose-of-requestanimationframe-method",
      "title": "What is the purpose of requestAnimationFrame method?",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Web APIs",
      "text": "### What is the purpose of `requestAnimationFrame` method?\n\n`requestAnimationFrame` is used to schedule animations in the browser for optimal performance.\n\n#### Key Points:\n1. **Synchronizes with Refresh Rate:**\n   - Ensures smooth animations by aligning with the screen refresh rate.\n\n2. **Efficient Rendering:**\n   - Avoids unnecessary frame rendering when the tab is inactive.\n\nExample:\n```javascript\nfunction animate() {\n  // Animation logic here\n  console.log('Animating...');\n  requestAnimationFrame(animate);\n}\n\nrequestAnimationFrame(animate);\n```"
    },
    {
      "link": "#what-is-the-purpose-of-seal-method",
      "title": "What is the purpose of seal method",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7458057057950895392",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### What is the purpose of seal method?\n\nThe `Object.seal()` method seals an object, preventing new properties from being added, but allowing modification of existing properties. The object is still mutable.\n\nExample:\n\n```javascript\nconst person = { name: 'John' };\nObject.seal(person);\nperson.name = 'Jane';\nconsole.log(person.name); // 'Jane'\nperson.age = 30; // This won't work\n```"
    },
    {
      "link": "#what-is-the-purpose-of-some-method-in-arrays",
      "title": "What is the purpose of some method in arrays",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Arrays",
      "text": "### What is the purpose of `some` method in arrays?\n\nThe `some` method tests whether at least one element in the array passes the provided test function. It returns `true` if any element meets the condition, otherwise `false`.\n\nExample:\n\n```javascript\nlet numbers = [1, 2, 3, 4, 5];\nlet hasEven = numbers.some(num => num % 2 === 0);\nconsole.log(hasEven);  // Output: true\n```"
    },
    {
      "link": "#what-is-the-purpose-of-switch-case",
      "title": "What is the purpose of switch-case",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, control structures",
      "text": "### What is the purpose of switch-case?\n\nThe `switch-case` statement is used to perform different actions based on different conditions. It is an alternative to multiple `if-else` statements and is more readable when there are many conditions to check.\n\nExample:\n\n```javascript\nconst fruit = 'apple';\nswitch(fruit) {\n  case 'apple':\n    console.log('Apple is selected');\n    break;\n  case 'banana':\n    console.log('Banana is selected');\n    break;\n  default:\n    console.log('Unknown fruit');\n}\n```"
    },
    {
      "link": "#what-is-the-purpose-of-the-this-keyword-in-javascript",
      "title": "What is the purpose of the this keyword in JavaScript?",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Scope",
      "text": "### What is the purpose of the `this` keyword in JavaScript?\n\nThe `this` keyword refers to the object that is executing the current function. Its value depends on how the function is called:\n\n1. **In a Method:** Refers to the object the method belongs to.\n2. **In a Function (non-strict mode):** Refers to the global object (`window` in browsers).\n3. **In a Function (strict mode):** Undefined.\n4. **In Arrow Functions:** Inherits `this` from the enclosing scope.\n\nExample:\n\n```javascript\nconst obj = {\n  name: 'Alice',\n  greet() {\n    console.log(`Hello, ${this.name}`);\n  }\n};\n\nobj.greet(); // 'Hello, Alice'\n```"
    },
    {
      "link": "#what-is-the-purpose-of-uneval",
      "title": "What is the purpose of uneval",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, eval",
      "text": "### What is the purpose of uneval?\n\n`uneval()` was used to return a string representation of an object or expression, similar to how `eval()` works. However, `uneval()` is deprecated and not supported in all environments.\n\nExample:\n\n```javascript\nconst obj = { name: 'John' };\nconsole.log(uneval(obj)); // '({ name: \"John\" })'\n```"
    },
    {
      "link": "#what-is-the-purpose-of-using-object-is-method",
      "title": "What is the purpose of using object is method",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### What is the purpose of using Object.is method?\n\n`Object.is()` is used to compare two values to check if they are the same. It is similar to `===` but handles special cases like `NaN` and `-0` differently.\n\nExample:\n\n```javascript\nconsole.log(Object.is(-0, +0)); // false\nconsole.log(Object.is(NaN, NaN)); // true\n```"
    },
    {
      "link": "#what-is-the-purpose-of-void-0",
      "title": "What is the purpose of void 0",
      "url": "https://www.tiktok.com/@jsmentoring/video/7454350834697080096",
      "level": "advanced",
      "theme": "JavaScript, operators",
      "text": "### What is the purpose of void 0?\n\n`void 0` is used to return `undefined` in JavaScript. It's a more reliable method than using `undefined` directly, which can be overwritten in some cases."
    },
    {
      "link": "#what-is-the-shortcut-to-get-timestamp",
      "title": "What is the shortcut to get timestamp",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Date",
      "text": "### What is the shortcut to get timestamp?\n\nIn JavaScript, you can get the current timestamp (in milliseconds) using the `Date.now()` method or `new Date().getTime()`.\n\nExample:\n\n```javascript\nlet timestamp = Date.now();\nconsole.log(timestamp);  // Output: current timestamp in milliseconds\n```"
    },
    {
      "link": "#what-is-the-use-of-preventdefault-method",
      "title": "What is the use of preventDefault method",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7454611976598113568",
      "level": "basic",
      "theme": "JavaScript, events",
      "text": "### What is the use of preventDefault method?\n\nThe `preventDefault()` method is used to cancel the default behavior of an event. For example, you can prevent the form from submitting or a link from navigating to a new page."
    },
    {
      "link": "#what-is-the-use-of-setinterval",
      "title": "What is the use of setInterval",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7455059689315896609",
      "level": "basic",
      "theme": "JavaScript, timing",
      "text": "### What is the use of setInterval?\n\nThe `setInterval()` method calls a function or code snippet repeatedly, with a fixed time delay between each call. It's useful for creating repeating actions.\n\n```javascript\nsetInterval(function(){ console.log('Hello!'); }, 1000);\n```"
    },
    {
      "link": "#what-is-the-use-of-settimeout",
      "title": "What is the use of setTimeout",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7453766380433722656",
      "level": "basic",
      "theme": "JavaScript, timing",
      "text": "### What is the use of setTimeout?\n\nThe `setTimeout()` method is used to execute a function or code snippet after a specified delay in milliseconds. It's useful for delaying the execution of a task.\n\n```javascript\nsetTimeout(function(){ alert('Hello!'); }, 2000);\n```"
    },
    {
      "link": "#what-is-the-use-of-stoppropagation-method",
      "title": "What is the use of stopPropagation method",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7454613743649951008",
      "level": "basic",
      "theme": "JavaScript, events",
      "text": "### What is the use of stopPropagation method?\n\nThe `stopPropagation()` method prevents the event from propagating (bubbling) up or down the DOM tree. This is useful for preventing parent elements from handling events triggered by child elements."
    },
    {
      "link": "#what-is-the-way-to-find-the-number-of-parameters-expected-by-a-function",
      "title": "What is the way to find the number of parameters expected by a function",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456397129393704224",
      "level": "basic",
      "theme": "JavaScript, functions",
      "text": "### What is the way to find the number of parameters expected by a function?\n\nYou can use the `length` property of a function to find the number of parameters it expects.\n\n```javascript\nfunction test(a, b, c) {}\nconsole.log(test.length); // 3\n```"
    },
    {
      "link": "#what-is-throttling",
      "title": "What is throttling?",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Performance",
      "text": "### What is throttling?\n\nThrottling ensures that a function is called at most once in a specified time interval. It is useful for rate-limiting events like scrolling or resizing.\n\nExample:\n\n```javascript\nfunction throttle(func, limit) {\n  let inThrottle;\n  return function(...args) {\n    if (!inThrottle) {\n      func.apply(this, args);\n      inThrottle = true;\n      setTimeout(() => (inThrottle = false), limit);\n    }\n  };\n}\n\nconst log = throttle(() => console.log('Throttled!'), 1000);\nwindow.addEventListener('scroll', log);\n```"
    },
    {
      "link": "#what-is-tree-shaking",
      "title": "What is tree shaking",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456569241815354657",
      "level": "basic",
      "theme": "JavaScript, optimization",
      "text": "### What is tree shaking?\n\nTree shaking is a process used in JavaScript bundlers (like Webpack) to remove unused code from the final bundle. It helps reduce the size of the final output and improves performance."
    },
    {
      "link": "#what-is-typescript",
      "title": "What is TypeScript",
      "url": "",
      "level": "basic",
      "theme": "TypeScript",
      "text": "### What is TypeScript?\n\nTypeScript is a superset of JavaScript that adds static types and modern features to the language. It allows you to write code with type annotations, which helps with early error detection, better tooling, and improved code maintainability. TypeScript code is transpiled to regular JavaScript.\n\nExample:\n\n```typescript\nlet num: number = 10;\nlet str: string = 'Hello';\n```"
    },
    {
      "link": "#what-is-v8-javascript-engine",
      "title": "What is V8 JavaScript engine",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, engines",
      "text": "### What is V8 JavaScript engine?\n\nV8 is an open-source JavaScript engine developed by Google. It is used in Chrome and Node.js. V8 compiles JavaScript directly to native machine code for fast execution.\n\nV8 optimizes JavaScript performance through techniques like Just-In-Time (JIT) compilation and garbage collection."
    },
    {
      "link": "#what-is-web-speech-api",
      "title": "What is web speech API",
      "url": "",
      "level": "advanced",
      "theme": "JavaScript, Web APIs",
      "text": "### What is Web Speech API?\n\nThe Web Speech API provides the ability to recognize and synthesize speech in web applications. It consists of two parts: the Speech Recognition API and the Speech Synthesis API.\n\n- **Speech Recognition API**: Allows the recognition of speech and converts it into text.\n- **Speech Synthesis API**: Allows the synthesis of speech from text.\n\nExample of Speech Synthesis:\n\n```javascript\nlet utterance = new SpeechSynthesisUtterance('Hello, World!');\nspeechSynthesis.speak(utterance);\n```"
    },
    {
      "link": "#what-paradigm-is-javascript",
      "title": "What paradigm is JavaScript",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Programming Paradigms",
      "text": "### What paradigm is JavaScript?\n\nJavaScript is a multi-paradigm language, supporting functional, object-oriented, and imperative programming styles. It allows you to write code in a variety of styles depending on the needs of the application.\n\nExample of functional style:\n\n```javascript\nlet add = (a, b) => a + b;\nconsole.log(add(2, 3));  // Output: 5\n```"
    },
    {
      "link": "#what-would-be-the-result-of-123",
      "title": "What would be the result of 1+2+'3'",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7456799873505987873",
      "level": "basic",
      "theme": "JavaScript, type coercion",
      "text": "### What would be the result of 1+2+'3'?\n\nIn JavaScript, `1 + 2 + '3'` results in `'33'` because the `+` operator first adds the numbers (`1 + 2 = 3`) and then concatenates the result with the string `'3'`.\n\nExample:\n\n```javascript\nconsole.log(1 + 2 + '3'); // '33'\n```"
    },
    {
      "link": "#when-you-get-a-syntax-error",
      "title": "When you get a syntax error",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, errors",
      "text": "### When you get a syntax error?\n\nA `SyntaxError` occurs when the JavaScript engine encounters code that doesn't conform to the syntax rules of the language. Common causes include missing brackets, semicolons, or incorrect use of keywords.\n\nExample:\n\n```javascript\n// Missing closing bracket\nif (true) {\n  console.log('Hello');\n```"
    },
    {
      "link": "#who-created-javascript",
      "title": "Who created JavaScript",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7454609808038153504",
      "level": "basic",
      "theme": "JavaScript, history",
      "text": "### Who created JavaScript?\n\nJavaScript was created by Brendan Eich in 1995 while working at Netscape Communications Corporation. It was originally called Mocha, then renamed to LiveScript, and finally to JavaScript."
    },
    {
      "link": "#why-do-i-need-to-use-freeze-method",
      "title": "Why do I need to use freeze method",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7457632028364737825",
      "level": "basic",
      "theme": "JavaScript, objects",
      "text": "### Why do I need to use freeze method?\n\nUsing `Object.freeze()` is useful when you want to ensure that the object’s properties cannot be changed, helping to prevent bugs caused by unintended modifications.\n\nExample:\n\n```javascript\nconst config = { maxLimit: 100 };\nObject.freeze(config);\nconfig.maxLimit = 200; // Won't work\n```"
    },
    {
      "link": "#why-do-we-call-javascript-as-dynamic-language",
      "title": "Why do we call javascript as dynamic language",
      "url": "",
      "level": "basic",
      "theme": "JavaScript, Language features",
      "text": "### Why do we call JavaScript a dynamic language?\n\nJavaScript is considered a dynamic language because it supports dynamic typing, meaning that variables do not have a fixed type. You can assign any type of value to a variable at runtime, and it can change its type during execution.\n\nExample:\n\n```javascript\nlet dynamicVar = 10;  // Number\ndynamicVar = 'Hello';  // String\n```"
    },
    {
      "link": "#why-do-you-need-json",
      "title": "Why do you need JSON",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7453770486993014049",
      "level": "basic",
      "theme": "JavaScript, data formats",
      "text": "### Why do you need JSON?\n\nJSON is used for exchanging data between a client and server, especially in web applications. It is lightweight, easy to parse, and widely supported by many programming languages."
    },
    {
      "link": "#why-do-you-need-obfuscation",
      "title": "Why do you need Obfuscation",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, security",
      "text": "### Why do you need Obfuscation?\n\nObfuscation is used to protect JavaScript code from being easily read, understood, or modified by unauthorized parties. This is particularly important in scenarios where the source code is exposed in the client-side, such as in web applications. By obfuscating the code, developers can help prevent reverse engineering and intellectual property theft.\n\nExample uses of obfuscation:\n- Protecting proprietary algorithms\n- Hiding sensitive information like API keys (though not recommended as a primary security measure)\n- Preventing unauthorized modifications"
    },
    {
      "link": "#why-do-you-need-to-avoid-with-statement",
      "title": "Why do you need to avoid with statement",
      "url": "",
      "level": "intermediate",
      "theme": "JavaScript, Best Practices",
      "text": "### Why do you need to avoid `with` statement?\n\nThe `with` statement is considered problematic because it makes the code harder to understand and maintain. It adds variables from an object to the scope, which can lead to confusion and unexpected behavior, especially in larger programs.\n\nIt is recommended to avoid using `with` in modern JavaScript.\n\nExample:\n\n```javascript\nwith (Math) {\n  console.log(sqrt(16));  // Works, but avoid it\n}\n```"
    },
    {
      "link": "#why-is-javascript-treated-as-single-threaded",
      "title": "Why is JavaScript treated as Single threaded",
      "url": "https://www.tiktok.com/@jsmentoring/photo/7455079370881879329",
      "level": "intermediate",
      "theme": "JavaScript, concurrency",
      "text": "### Why is JavaScript treated as Single threaded?\n\nJavaScript is single-threaded because it executes code in one thread, meaning only one operation can be performed at a time. This simplifies development, but asynchronous programming techniques like callbacks, promises, and async/await are used to handle concurrency."
    }
  ]