Exploring A* search algorithm and it's JavaScript implementation