結果 : how to avoid nan in javascript