結果 : javascript function returns undefined instead of value