The code 1(any number)/undefined will be NaN. So, this code can also prevent the execution of the case that duration is undefined.