Javascript solution

Yup. This is what I get for using Githubs web editor...