how to convert nan to number in javascript