Skip to content

Conversation

@jayther
Copy link

@jayther jayther commented Nov 27, 2017

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant