add javascript solution