Challenge-Build-Your-Own-Array-In-Js icon indicating copy to clipboard operation
Challenge-Build-Your-Own-Array-In-Js copied to clipboard

My "Intro to C++" solution

Open jayther opened this issue 8 years ago • 0 comments

My "Intro to C++" solution, at least from what I remember, except for the growth factor and the JavaScript-only functions. It's been more than a decade.

  • Growth factor has linear growth. 🤷‍♂️
  • splice is kind of long, not sure how to shorten it.
  • I chose to interact with this.elements as much as possible instead of using MyArray's own functions. In a separate branch (available in my repo), I refactored to use its own functions, but to me, it became less readable, especially in splice.
  • Implementing the shift and unshift functions, as useful as they are, made me wish linked lists were a thing in core JavaScript lol.

This was a fun challenge! Half of it were straightforward, but the splice function definitely threw me in for a loop. I'm interested in seeing others' solutions, especially with splice!

jayther avatar Nov 27 '17 08:11 jayther