My JavaScript solution to the Gilded Rose kata