Add #12 JavaScript solution