JavaScript Data Structures and Algorithm -stuck in step23

Hi! Please share your code, use the backticks (```). How to do:
Forum code formatting