摘要:
findIndex方法:(不改变原数据) var arr = [ {name:'张三',sex:'男'}, {name:'李四',sex:'男'}, {name:'王二',sex:'女'} ] var lisi= arr.findIndex(function(obj){ return obj.nam 阅读全文
摘要:
string.trim()//去掉字符串空白(如:空格) string.padStart(8,'0')//用'0'在原字符串左边补位到长度为8,也可用别的任意字符串进行补位,若长度超出设置的长度,则从左往右取,如: '666'.padStart(5,'123')//'12666' string.pa 阅读全文
摘要:
const obj = { name: 'Jack', age: '18', gender: '男' } for (key in obj) { console.log(key)//name age gender console.log(typeof key)//string string strin 阅读全文