Add #42 JavaScript solution