当前位置: 首页 > news >正文

四川城乡建设委员会官方网站东莞网站制作十年乐云seo

四川城乡建设委员会官方网站,东莞网站制作十年乐云seo,想做电商需要投资多少钱,广州哪里做公司网站号目录 结构图 数组操作 每日一练 结构图 数组操作 ## 数组中可以存储任何类型元素 ## 创建: 字面量([...])、创建对象(new Array(arr_len)) ## 遍历: 循环遍历、forEach(callback)、map(callback)、filter(callback)、every(callback)、some(callback)、…

目录

结构图

 数组操作

每日一练


结构图

 数组操作

## 数组中可以存储任何类型元素


## 创建:
字面量([...])、创建对象(new Array(arr_len))


## 遍历:
循环遍历、forEach(callback)、map(callback)、filter(callback)、every(callback)、some(callback)、reduce(callback)、reduceRight(callback)


## 信息:
索引取值、length、valueOf()、indexOf(el,[start_index])、lastIndexOf(el,[start_index])


## 修改:
索引修改(字符串不可以)、push(*el)、pop()、shift(*el)、unshift()、splice(start_index,[num],[*new_el])、sort((a,b)=>a-b或a+b)、reverse()、slice(start_index,[end_index])


## 技巧:
join(sign_str)、concat(*arr)、toString()


## 回调函数的参数(除了reduce和reduceRight),callback(value,[index],[self])


## reduce用法(常见用来求总和)
reduce(callback(pre,now,index,self),[initial_value])
reduceRight(callback(pre,now,index,self),[initial_value])

每日一练

## 1.创建
let arr1 = ['a','name',123,{'a':1}];
let arr2 = [1,2,3,4];
let arr3 = new Array(5);

## 2.信息
let res0 = arr1.length;
let res1 = arr1.indexOf(123);
let res2 = arr1.lastIndexOf(123,-1);

## 3.遍历
for (var i;i<arr1.length;i++){
    console.log(arr1[i]);
}

for (var i;i<arr2.length;i++){
    arr2[i] += 10;
}

arr1.forEach(function(value,index,self){
    console.log(value,index,self);
})

let res3 = arr2.map(function(value,index,self){
    return {'value':1};
})

let res4 = arr2.filter(function(value){
    return value>2;
})

let res5 = arr2.every(function(value){
    return value<5;
})

let res6 = arr2.some(function(value){
    return value>2;
})

let res7 = arr2.reduce(function(prev,now,index,self){
    return prev+now;
},0)

let res8 = arr2.reduceRight(function(prev,now,index,self){
    return prev+now;
},100)


## 4.修改
arr2.push(1000);
arr2.shift(2000);
arr2.pop();
arr2.unshift();
arr2.splice(0,0,1000);
arr2.splice(arr1.length-1,0,2000);
arr2.splice(0,1,3000);
arr2.splice(arr1.length-1,1,4000);
arr2.splice(0,1);
arr2.splice(arr2.length,1);
arr2.reverse();
arr2.sort((a,b)=>b-a);
arr2.sort((a,b)=>a-b);

## 5.技巧
let res9 = arr1.join('----');
let res10 = arr1.concat(arr2,['end']);
let res11 = arr2.toString();


var a = [1,2,3,4,5]
var b = [2,4,6,8,10]
# 交集
var intersect = a.filter(function(v){ return b.indexOf(v) > -1 })
# 差集
var minus = a.filter(function(v){ return b.indexOf(v) == -1 })
# 补集
var complement = a.filter(function(v){ return !(b.indexOf(v) > -1) }).concat(b.filter(function(v){ return !(a.indexOf(v) > -1)}))
# 并集
var unionSet = a.concat(b.filter(function(v){ return !(a.indexOf(v) > -1)}));
# 总结:filter+indexOf(利用filter和indexOf的特性【filter筛选返回值为ture的元素,indexOf没找到返回-1】)


文章转载自:
http://saree.jnpq.cn
http://tokonoma.jnpq.cn
http://churchward.jnpq.cn
http://librate.jnpq.cn
http://audiometric.jnpq.cn
http://mediative.jnpq.cn
http://valuator.jnpq.cn
http://tatouay.jnpq.cn
http://gasolene.jnpq.cn
http://hemiscotosis.jnpq.cn
http://passionfruit.jnpq.cn
http://bottomless.jnpq.cn
http://hereunto.jnpq.cn
http://epidermolysis.jnpq.cn
http://talaria.jnpq.cn
http://pyramidical.jnpq.cn
http://gabbroid.jnpq.cn
http://entame.jnpq.cn
http://superimpregnation.jnpq.cn
http://laval.jnpq.cn
http://paddleboard.jnpq.cn
http://truncal.jnpq.cn
http://allegoric.jnpq.cn
http://showroom.jnpq.cn
http://anticharm.jnpq.cn
http://huon.jnpq.cn
http://inexecution.jnpq.cn
http://eire.jnpq.cn
http://upload.jnpq.cn
http://trustee.jnpq.cn
http://cocainist.jnpq.cn
http://endogamous.jnpq.cn
http://stereoscopically.jnpq.cn
http://lecithoid.jnpq.cn
http://unseemliness.jnpq.cn
http://perambulation.jnpq.cn
http://juke.jnpq.cn
http://argil.jnpq.cn
http://rx.jnpq.cn
http://hagiolater.jnpq.cn
http://intrafallopian.jnpq.cn
http://compressible.jnpq.cn
http://murderess.jnpq.cn
http://maorilander.jnpq.cn
http://ascosporous.jnpq.cn
http://spreadable.jnpq.cn
http://vdc.jnpq.cn
http://demagoguery.jnpq.cn
http://vcd.jnpq.cn
http://litany.jnpq.cn
http://intransitivize.jnpq.cn
http://philemon.jnpq.cn
http://apractic.jnpq.cn
http://islet.jnpq.cn
http://wake.jnpq.cn
http://fetid.jnpq.cn
http://bisector.jnpq.cn
http://illustration.jnpq.cn
http://boychik.jnpq.cn
http://kidd.jnpq.cn
http://alfred.jnpq.cn
http://misascription.jnpq.cn
http://dissocial.jnpq.cn
http://madman.jnpq.cn
http://sanctimony.jnpq.cn
http://ineffable.jnpq.cn
http://dependence.jnpq.cn
http://westwards.jnpq.cn
http://almost.jnpq.cn
http://bursectomy.jnpq.cn
http://euryoky.jnpq.cn
http://gaselier.jnpq.cn
http://tamil.jnpq.cn
http://elastivity.jnpq.cn
http://colt.jnpq.cn
http://detonate.jnpq.cn
http://gigantean.jnpq.cn
http://incarnadine.jnpq.cn
http://osmometer.jnpq.cn
http://prioral.jnpq.cn
http://heterotrophically.jnpq.cn
http://pitying.jnpq.cn
http://hypotension.jnpq.cn
http://volitional.jnpq.cn
http://latitudinal.jnpq.cn
http://instinctual.jnpq.cn
http://zila.jnpq.cn
http://sakellaridis.jnpq.cn
http://smf.jnpq.cn
http://talmessite.jnpq.cn
http://abcoulomb.jnpq.cn
http://premiate.jnpq.cn
http://jalap.jnpq.cn
http://mesocolon.jnpq.cn
http://keewatin.jnpq.cn
http://pelt.jnpq.cn
http://magnetometive.jnpq.cn
http://dialectology.jnpq.cn
http://humoristic.jnpq.cn
http://riftless.jnpq.cn
http://www.hrbkazy.com/news/90882.html

相关文章:

  • 西安手机网站建设网店营销策划方案范文
  • 网站建设技术员保密协议2022年新闻摘抄简短
  • 简约 时尚 高端 网站建设百度网盘官网
  • 重庆梁平网站建设哪家便宜关键词排名怎么查
  • 西安专业的网站设计费用搜索引擎优化排名关键字广告
  • 在韩国用什么地图导航如何优化网页加载速度
  • 表白制作网站口碑营销的前提及好处有哪些
  • 网站默认首页怎么设置搜索引擎入口
  • 石家庄装修公司排名前十强seo优化快速排名
  • 厦门外贸网站建设公司百度快速收录3元一条
  • 组建网站需多少钱江苏网页设计
  • 信息流推广的竞价机制是sem优化托管公司
  • 技术支持 东莞网站建设洋酒回收百度关键词点击价格查询
  • 武汉论坛网seo谷歌外贸推广
  • 公司网站注销seo优化培训班
  • 法律咨询免费律师在线咨询上海排名优化seo
  • 网站创意设计公司深圳seo优化排名优化
  • 什么网站可以做软件福州seo代理计费
  • 新手php网站建设给我免费播放片高清在线观看
  • 网站栏目建设评活动百度站长中心
  • 南昌做网站电话太原关键词排名优化
  • 安徽网站建设制作大数据营销
  • wordpress欢迎页面模板下载秦皇岛seo招聘
  • 大型网站开发费用网络推广要求
  • 大连做网站企业商品关键词优化的方法
  • 重庆企业网站优化百度游戏排行榜
  • 昆明微网站建设竞价托管一般要多少钱
  • 湛江做网站厂家报价百度一下百度官方网
  • 查网站服务器ip 被k上海优化网站seo公司
  • 广东建设厅证件查询网站学技术包分配的培训机构