js 字符转换,小驼峰转大写字母开头并且加空格 changeDate -》 Change Date
let arr = [ 'changedBy', 'changedDate', 'createdBy', 'createdDate', 'deleteFlag' ] arr = arr.map(value => { let str = value.replace(/([A-Z])/g," $1") let name = str.substr(0,1).toUpperCase() + str.substr(1) return { name: name, width: 160, isShow: true, value: value } }) console.log(JSON.stringify(arr))