Why practice on FrontendArk?
Technologies Covered
Practice questions tailored for modern frontend.
Popular & Recently Added
View allDesign a function `createCounter` that takes an optional starting number.
Create a function called `useBoolean` that manages a boolean state.
Create a utility function called useCounter that helps you manage a numeric counter. It should provide methods to increase, decrease, reset, and directly set the counter value.
Write a function called mean that calculates the average value of all numbers in an array. If the array is empty, the function should return NaN.
The built-in JavaScript method `Function.prototype.call()` allows you to invoke a function with an explicit `this` value and arguments passed one by one. Your task: Implement a custom version named `Function.prototype.myCall`. ⚠️ You should not use the native `call` method internally.
Write a function `minBy(array, iteratee)` that looks through an array and returns the element for which the provided iteratee function produces the smallest value. ⚠️ If the iteratee returns `null` or `undefined` for every element, the function should return `undefined`. **Examples:** ```js minBy([2, 3, 1, 4], (num) => num); // => 1 minBy([{ n: 1 }, { n: 2 }], (o) => o.n); // => { n: 1 } minBy([{ n: 1 }, { n: 2 }], (o) => o.m); // => undefined ```
How it works
Resources Spotlight
Explore allWhat learners say
“The problems feel like real interview tasks.”
“Clean UI and instant feedback helped me ship faster.”
“Loved the React preview and JS utilities focus.”