Skip to content

JavaScript

JavaScript, the backbone of the web and a magical language used to build almost anything from a ToDo app to the SpaceX rocket control panel.

Apply Transform Over Each Element in Array - 2635

Apply Transform Over Each Element in Array – 2635

🔗LC2635 🟢 Easy 🧩 Pattern – Array Transformations 📅 Day 5/30 Days of JavaScript Given an integer array arr and a mapping function fn, return a new array with a transformation applied to each element. The returned array should be created such that returnedArray[i] = fn(arr[i], i). Please solve it without the built-in Array.map method.… Read More »Apply Transform Over Each Element in Array – 2635

Counter II - 2665

Counter II – 2665

🔗LC2665 🟢 Easy 🧩 Pattern – Closures 📅 Day 4/30 Days of JavaScript Write a function createCounter. It should accept an initial integer init. It should return an object with three functions. The three functions are: Example Solution We return an object with the three required functions as properties, we implement a… Read More »Counter II – 2665

To Be Or Not To Be – 2704

🔗LC2704 🟢 Easy 🧩 Pattern – Closures 📅 Day 3/30 Days of JavaScript Write a function expect that helps developers test their code. It should take in any value val and return an object with the following two functions. Example Solution Here, we need to understand how we are returning an object that… Read More »To Be Or Not To Be – 2704

Counter - 2620

Counter – 2620

🔗LC2620 🟢 Easy 🧩 Pattern – Closures 📅 Day 2/30 Days of JavaScript Given an integer n, return a counter function. This counter function initially returns n and then returns 1 more than the previous value every subsequent time it is called (n, n + 1, n + 2, etc). Example Solution In JavaScript,… Read More »Counter – 2620