added #1000 solution in JS
added #1001 solution in JS