Reverse String Using While Loop In Javascript