My answers to the exercises in Algorithms & Data Structures with JS

Exercise 2:
Exercise 3:
Exercise 4: