I’ve been learning a lot about data structures and algorithms lately and I’ve noticed in my reading that there aren’t a lot of examples showing implementations of algorithms in Javascript. You’ll mostly find examples in Java, Python, C, C++ etc. Maybe there’s a reason for preferring these languages over Javascript? I’m not sure.

In this first part, I’m going to show Javascript implementations of three sorting algorithms:

- Merge sort
- Insertion sort
- Bubble sort

This is not intended to be an in-depth explanation on the ins and outs of how the algorithms work and their performance. If you’d rather read about that, here’s a nice resource I found: Sorting Algorithms