Frontend101 logoFrontend101
Language

JavaScript

JavaScript internals, closures, prototypes, async/event loop, and DOM fundamentals.

← All Sections
25 of 25 questions
25 questions
#1JavaScript functionsEasy4 test cases
Practice & Run Tests →

Function.prototype.bind

Implement your own Function.prototype.bind without calling the native bind method. To avoid overwriting the actual Function.prototype.bind, implement the function as Function.prototype.myBind.

JavaScriptClosures & Scope
#2JavaScript functionsMedium4 test cases
Practice & Run Tests →

Promisify

Implement a promisify(func) utility that converts an error-first callback-based function into a function returning a Promise, while preserving the call-time `this` context.

JavaScriptClosures & ScopeAsync & Promises
#3JavaScript functionsMedium4 test cases
Practice & Run Tests →

JSON.stringify

Implement a simplified jsonStringify(value) function using recursion that converts JavaScript primitives, arrays, and nested objects into a JSON string.

JavaScript
#45QuizEasy2 test cases
Practice & Run Tests →

What's the difference between an "attribute" and a "property" in the DOM?

Attributes are defined in HTML and provide initial values; properties live on the DOM node and reflect the current live state.

Web APIsJavaScriptHTML
#46QuizMedium3 test cases
Practice & Run Tests →

Why is extending built-in JavaScript objects not a good idea?

Mutating native prototypes (like Array.prototype) risks naming collisions, breaks for...in loops, and conflicts with future language specs.

JavaScriptOOP
#47QuizMedium2 test cases
Practice & Run Tests →

Why is it, in general, a good idea to leave the global JavaScript scope of a website as-is and never touch it?

Polluting the global scope causes variable collisions between scripts, harder debugging, and unintended memory retention.

JavaScript
#48QuizMedium2 test cases
Practice & Run Tests →

Why might you want to create static class members in JavaScript?

Static fields and methods belong to the class constructor itself, ideal for shared utilities, constants, and factory methods.

JavaScriptOOP
#49QuizMedium2 test cases
Practice & Run Tests →

What's the difference between feature detection, feature inference, and using the UA string?

Feature detection directly checks if an API exists; feature inference assumes unrelated APIs from one check; UA sniffing parses navigator.userAgent.

BrowserJavaScript
#4JavaScript functionsMedium2 test cases
Practice & Run Tests →

EventEmitter

Implement an EventEmitter class supporting on(event, listener), off(event, listener), and emit(event, ...args).

JavaScriptOOP
#5JavaScript functionsMedium1 test cases
Practice & Run Tests →

getElementsByClassName

Implement getElementsByClassName(root, classNames) to recursively find all descendant nodes containing all specified space-separated class names.

JavaScriptWeb APIsHTML
#6JavaScript functionsEasy1 test cases
Practice & Run Tests →

Memoize

Implement a memoize(fn) higher-order function that caches results based on input arguments.

JavaScriptClosures & Scope
#7JavaScript functionsMedium1 test cases
Practice & Run Tests →

deepOmit

Implement deepOmit(val, keys) to recursively remove all specified keys from nested objects and arrays without mutating the original.

JavaScript
#8JavaScript functionsMedium1 test cases
Practice & Run Tests →

mapAsyncLimit

Implement mapAsyncLimit(iterable, callbackFn, size) to run an async mapper with at most `size` concurrent operations.

JavaScriptAsync & Promises
#9JavaScript functionsMedium1 test cases
Practice & Run Tests →

getElementsByStyle

Implement getElementsByStyle(root, property, value) to find all descendant nodes whose style[property] matches value.

JavaScriptWeb APIsHTML
#10JavaScript functionsMedium1 test cases
Practice & Run Tests →

Deep Copy (deepClone)

Implement deepClone(value) to recursively clone primitives, arrays, Dates, and plain objects.

JavaScript
#11JavaScript functionsEasy1 test cases
Practice & Run Tests →

Debounce

Implement debounce(fn, wait) that delays invoking fn until after `wait` milliseconds have elapsed since the last call.

JavaScriptClosures & ScopeAsync & Promises
#12JavaScript functionsMedium1 test cases
Practice & Run Tests →

Throttle

Implement throttle(fn, wait) so fn executes at most once every `wait` milliseconds.

JavaScriptClosures & ScopeAsync & Promises
#13Algorithmic codingMedium1 test cases
Practice & Run Tests →

Implement a Trie (Prefix Tree)

Implement a Trie data structure with insert(word), search(word), and startsWith(prefix) methods.

JavaScriptOOP
#14JavaScript functionsMedium1 test cases
Practice & Run Tests →

Flatten Nested Object

Implement flattenObject(obj) to flatten deeply nested objects into a single-level object with dot-separated keys.

JavaScript
#15JavaScript functionsMedium1 test cases
Practice & Run Tests →

Promise.any Polyfill

Implement promiseAny(iterable) that resolves as soon as any promise fulfills, or rejects with an AggregateError if all reject.

JavaScriptAsync & Promises
#16JavaScript functionsEasy1 test cases
Practice & Run Tests →

Function.prototype.call

Implement Function.prototype.myCall(thisArg, ...args) without calling native call() or apply().

JavaScriptClosures & Scope
#17JavaScript functionsEasy1 test cases
Practice & Run Tests →

Array.prototype.myMap

Implement Array.prototype.myMap(callbackFn, thisArg) to mirror native Array.prototype.map.

JavaScript
#18QuizEasy1 test cases
Practice & Run Tests →

Closures & Loop Scoping (var vs let)

Fix a classic loop closure bug so each callback captures its own iteration index instead of sharing the final loop value.

JavaScriptClosures & Scope
#19QuizMedium1 test cases
Practice & Run Tests →

Microtask Queue & Event Loop Order

Predict and verify the execution order across synchronous code, Promise.then microtasks, and setTimeout macrotasks.

JavaScriptAsync & Promises
#20QuizEasy1 test cases
Practice & Run Tests →

Prototype Chaining

Implement createChild(parentProto, ownProps) using Object.create so own properties shadow inherited prototype properties.

JavaScriptOOP

JavaScript Blog

10 articles

Articles related to JavaScript.

Nov 29, 2026 · 31 min readRead article →

101 JavaScript Output-Based Interview Questions (With Options & Explanations)

Test your JavaScript fundamentals with 101 output-based MCQ questions covering hoisting, closures, event loop, promises, prototypes, coercion, and this — each with 4 options and collapsible answers.

#javascript#interview-questions#output-based#mcq
Oct 30, 2026 · 12 min readRead article →

Caching in React: A Complete Guide to Building Faster Web Applications

Imagine opening an e-commerce website, browsing products, visiting a product details page, and returning to the product listing. Photo by Rubaitul Azad on Unsplash Should the...

#caching#react
Oct 29, 2026 · 2 min readRead article →

Building an EventEmitter in JavaScript

Ever wondered how JavaScript lets you subscribe to events and react when something happens? Let’s build a simple EventEmitter from scratch — a common frontend machine-coding...

#javascript
Oct 29, 2026 · 2 min readRead article →

Building getElementsByClassName() from Scratch in JavaScript

Ever wondered how to implement a native DOM method yourself? This frontend problem is a great way to practice DOM traversal, recursion, and class matching . Photo by Daniil...

#javascript
Oct 29, 2026 · 2 min readRead article →

Implementing JSON.stringify() Using Recursion in JavaScript

Ever wondered how JSON.stringify() converts a nested JavaScript object into a string? Let's build a simplified version ourselves! 🚀 Photo by James Harrison on Unsplash The idea...

#javascript
Oct 26, 2026 · 5 min readRead article →

JavaScript Promisify: Convert Callbacks into Promises

Introduction Before Promises and async/await became popular, JavaScript used callbacks to handle asynchronous operations. For example, a function might call a callback when an...

#javascript
Oct 26, 2026 · 6 min readRead article →

JavaScript Interview: Implement deepOmit() Without Mutating the Original Object

Problem Statement Implement deepOmit(val, keys) to remove specified keys from an object, including nested objects and arrays, without modifying the original object . For...

#javascript
Oct 25, 2026 · 4 min readRead article →

Implementing mapAsyncLimit in JavaScript

1. Problem Statement Implement mapAsyncLimit(iterable, callbackFn, size) to apply an asynchronous callback to every array element while limiting the number of tasks running...

#javascript
Oct 24, 2026 · 3 min readRead article →

Implementing getElementsByStyle() in JavaScript

How can we find all DOM elements that match a specific CSS property and value without using querySelectorAll()? The solution uses DOM traversal and recursion to visit every...

#html#javascript#css
Oct 22, 2026 · 1 min readRead article →

Implementing Throttle in JavaScript: A Beginner-Friendly Guide

In JavaScript, events such as scrolling, resizing, and mouse movement can fire hundreds of times within a few seconds. Continue reading on JavaScript in Plain English »

#throttle#javascript#satish-shriwas