All Projects → waterlink → Challenge Build Your Own Array In Js

waterlink / Challenge Build Your Own Array In Js

Licence: mit
This is a challenge that will allow you to practice your logical, analytical and problem-solving skills. Additionally, by the end of it you’ll have much better command of arrays in javascript.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Challenge Build Your Own Array In Js

coding challenge-14
Understanding JavaScript and coding without the help of a library or tool
Stars: ✭ 22 (-87.28%)
Mutual labels:  challenge, vanilla-js
Uacme
ACMEv2 client written in plain C with minimal dependencies
Stars: ✭ 155 (-10.4%)
Mutual labels:  challenge
Dailycodingproblem
Stars: ✭ 113 (-34.68%)
Mutual labels:  challenge
Xview Yolov3
xView 2018 Object Detection Challenge: YOLOv3 Training and Inference.
Stars: ✭ 133 (-23.12%)
Mutual labels:  challenge
Jeopardy Dockerfiles
🇨🇳 🏁 🚩 Dockerfiles of CTF Challenges running on SniperOJ
Stars: ✭ 114 (-34.1%)
Mutual labels:  challenge
Bootcamp Gostack Desafio 03
Desafio do terceiro módulo do Bootcamp GoStack 🚀👨🏻‍🚀
Stars: ✭ 140 (-19.08%)
Mutual labels:  challenge
Mussum Ipsum
JS Lorem Ipsum generator
Stars: ✭ 110 (-36.42%)
Mutual labels:  vanilla-js
Bs Custom File Input
A little plugin for Bootstrap 4 custom file input
Stars: ✭ 162 (-6.36%)
Mutual labels:  vanilla-js
Open Solution Toxic Comments
Open solution to the Toxic Comment Classification Challenge
Stars: ✭ 154 (-10.98%)
Mutual labels:  challenge
Nanocal
Airbnb range picker rip-off
Stars: ✭ 132 (-23.7%)
Mutual labels:  vanilla-js
Datascicomp
A collection of popular Data Science Challenges/Competitions || Countdown timers to keep track of the entry deadlines.
Stars: ✭ 1,636 (+845.66%)
Mutual labels:  challenge
Vanillajs Deck
A Vanilla.js Single Page App (SPA) slide deck for a presentation about Vanilla.js written with no frameworks.
Stars: ✭ 119 (-31.21%)
Mutual labels:  vanilla-js
Svelte Carousel
A super lightweight, super simple Carousel for Svelte 3
Stars: ✭ 144 (-16.76%)
Mutual labels:  vanilla-js
Cinc Challenge2017
ECG classification from short single lead segments (Computing in Cardiology Challenge 2017 entry)
Stars: ✭ 112 (-35.26%)
Mutual labels:  challenge
Instagrapi
Fast and effective Instagram Private API wrapper
Stars: ✭ 157 (-9.25%)
Mutual labels:  challenge
Scaffold Static
Scaffolding utility for vanilla-js
Stars: ✭ 111 (-35.84%)
Mutual labels:  vanilla-js
Google Foobar Help
Guidance on how to tackle some of the foobar challenges.
Stars: ✭ 127 (-26.59%)
Mutual labels:  challenge
27daysofcode
A repo with small projects
Stars: ✭ 140 (-19.08%)
Mutual labels:  challenge
Jsontree
A lightweight vanilla Javascript micro-library for making collapsible trees with JSON
Stars: ✭ 170 (-1.73%)
Mutual labels:  vanilla-js
Mailtoui
A simple way to enhance your mailto links with a convenient user interface.
Stars: ✭ 162 (-6.36%)
Mutual labels:  vanilla-js

Challenge “Build Your Own Array in Javascript!”

Rules are simple:

  • I give you a test suite for (almost) all the functionality of the array.
  • You implement that functionality in the class MyArray.
  • You can’t use standard javascript’s Array, instead you need to use the provided wrapper PlainArray that limits what you can do:
class PlainArray<T> {
    constructor(capacity: number)
    length: number
    get(index: number): T
    set(index: number, value: T)
}
  • PlainArray is a fixed-size array that has one property and two methods defined: length, get(index) and set(index, value).
  • Even though the definition of that class is in Typescript, you will have to use vanilla ECMA Script 5.
  • Focus more on readability over the performance.

How to Run The Test Suite?

First, you’ll need to clone this repository:

$ git clone https://github.com/waterlink/Challenge-Build-Your-Own-Array-In-Js
$ cd Challenge-Build-Your-Own-Array-In-Js

You will need to open SpecRunner.html in your browser. You can launch it from the directory in your file explorer, or you could run it from terminal:

# Mac OS X:
$ open ./SpecRunner.html

# Most Linuxes
$ xdg-open ./SpecRunner.html

You should see something like that:

To see the test suite open ./spec/MyArraySpec.js and start making these failing tests pass one by one.

I recommend starting with the top ones, as they get harder towards the bottom.

Why?

So that you can practice your logical and problem-solving skills.

Additionally, by the end of this challenge, you’ll have much more mastery over the use of arrays in javascript.

I’m Done. Now What?

Send me a pull request to this GitHub repository. And take a look at everyone else’s solution, as well!

Just don’t peek before you are done ;)

Thank you!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].