Implement one array method with test for it using Jest and send in a Pull Request.
This is to familiarize you with open source contribution, CI and of course Testing.
-
Read this step by step guide to get your code into this repository
-
Pick an array method, there is a list here make sure no one has written it.
-
Create a new file in the
src
directory<METHOD_NAME>.js
e.gmap.js
make sure the method hasn't been written already. -
create a new file to write your tests
<METHOD_NAME>.test.js
e.gmap.test.js
-
I wrote
map.js
andmap.test.js
feel free to use it as a template -
Check MDN for the signature of the array method you have chosen to write
-
You canβt reuse any array method in your implementation e.g forEach, map. Use
for
,while
,for-of
,... if you need to iterate. -
In the
__test__
directory, create a new file <METHOD_NAME>.test.js, check__test__/map.test.js
for a test sample to guide your implementation. You must write enough test for any array method you implement. -
Add a link to your GitHub profile and the method you implemeted to the contributors section.
-
Your method should be prefixed with an _ e.g
Array.prototype._map = function(){}
-
You can't write a method that someone has previously written. Please check contributions section below to see all methods that have been implemented.
....more
- marvinjude (map)