JS数据类型-数组和undefined 背景 在调拨管理模块下,根据选择的日期(Ant Design的RangerPicker实现)导出选择内容的文件 问题点:如果选择日期为空,报错为Cannot read property ‘format’ of undefined 目的:如果选择日期为空,则按照空处理,不能出现报错 原代码 createTimeStart: createTime && createTime.length > 0 ? createTime[0].format('X')<