DEV Community

Cover image for Monday Express Day [5]
Cliff Gor
Cliff Gor

Posted on

2 2

Monday Express Day [5]

Hello, welcome to the fifth BigO notation challenge where we will be solving a few challenges.

Goodmorning again welcome to #mondayexpress, today we will be heading over to our exercisim team where each week I share new challenges to fix.

Here is today's challenge

Introduction
Implement the accumulate operation, which, given a collection and an operation to perform on each element of the collection, returns a new collection containing the result of applying that operation to each element of the input collection.

Given the collection of numbers:

1, 2, 3, 4, 5
And the operation:

square a number (x => x * x)
Your code should be able to produce the collection of squares:

1, 4, 9, 16, 25
Check out the test suite to see the expected function signature.

Restrictions
Keep your hands off that collect/map/fmap/whatchamacallit functionality provided by your standard library! Solve this one yourself using other basic tools instead.

Setup
Go through the setup instructions for Javascript to install the necessary dependencies:

https://exercism.io/tracks/javascript/installation

Requirements
Please cd into exercise directory before running all below commands.

Install assignment dependencies:

$ npm install

Making the test suite pass
Execute the tests with:

$ npm test

In the test suites all tests but the first have been skipped.

Once you get a test passing, you can enable the next one by changing xtest to test.

Submitting Solutions
Once you have a solution ready, you can submit it using:

exercism submit accumulate.js
Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.

To Join click on the link here Monday Express. If you need more languages covered you can always reach out

Let's Join and solve these challenges.

Top comments (0)

SurveyJS custom survey software

JavaScript Form Builder UI Component

Generate dynamic JSON-driven forms directly in your JavaScript app (Angular, React, Vue.js, jQuery) with a fully customizable drag-and-drop form builder. Easily integrate with any backend system and retain full ownership over your data, with no user or form submission limits.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay