JavaScript program to write text reverse