adding JS solution for #11