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

卖网站模板百度seo正规优化

卖网站模板,百度seo正规优化,广州天河网站开发公司,网站建设方案书组网方案从尾到头搜索数组 在 JavaScript 中,通过 find() 和 findIndex() 查找数组中的值是一种常见做法。不过,这些方法从数组的开始进行遍历: const array [{v: 1}, {v: 2}, {v: 3}, {v: 4}, {v: 5}];array.find(elem > elem.v > 3); // {v:…
  1. 从尾到头搜索数组
    在 JavaScript 中,通过 find() 和 findIndex() 查找数组中的值是一种常见做法。不过,这些方法从数组的开始进行遍历:
    const array = [{v: 1}, {v: 2}, {v: 3}, {v: 4}, {v: 5}];array.find(elem => elem.v > 3); // {v: 4}
    array.findIndex(elem => elem.v > 3); // 3
    findLast() 会返回第一个查找到的元素,如果没有找到,就会返回 undefined;
    findLastIndex() 会返回第一个查找到的元素的索引。如果没有找到,就会返回 -1;
     const array = [{v: 1}, {v: 2}, {v: 3}, {v: 4}, {v: 5}];array.findLast(elem => elem.v > 3); // {v: 5}array.findLastIndex(elem => elem.v > 3); // 4array.findLastIndex(elem => elem.v > 5); // undefined
  2. 通过副本更改数组
    方法有4个
    Array.prototype.toReversed()
    Array.prototype.toSorted()
    Array.prototype.toSpliced()
    Array.prototype.with()

    我们知道,大多数的数组方法都是非破坏性的,也就是不会改变原数组,比如 filter() 方法
    当然,也有一些是破坏性的方法,它们在执行时会改变原数组,比如 sort() 方法
    在数组的方法中,下面的方法是具有破坏性的:
    reverse()
    sort()
    splice()

    如果想要不破坏数组,需要创建一个数组副本,对副本进行修改,因此就引入了这三个方法的非破坏性版本,因此不需要手动创建副本再进行操作了

    reverse() 的非破坏性版本:toReversed()
    sort() 非破坏性版本:toSorted(compareFn)
    splice() 非破坏性版本:toSpliced(start, deleteCount, ...items)

    除此之外,还有了一个新的非破坏性方法:with()。该方法会以非破坏性的方式替换给定 index 处的数组元素,即 arr[index]=value 的非破坏性版本。
     

    类型化数组也是数组,只不过其元素被设置为特定类型的值。类型化数组的核心就是一个名为 ArrayBuffer 的类型。每个 ArrayBuffer 对象表示的只是内存中指定的字节数,但不会指定这些字节用于保存什么类型的数据。通过 ArrayBuffer 能做的就是为了将来使用而分配一定数量的字节。
    这些方法也适用于元组,元组相当于不可变的数组。它们拥有数组的所有方法 —— 除了破坏性的方法
    toReversed() 是 reverse() 方法的非破坏性版本:

    const arr = ['a', 'b', 'c'];
    const result = arr.toReversed();
    console.log(result); // ['c', 'b', 'a']
    console.log(arr);    // ['a', 'b', 'c']

    toSorted() 是 sort() 方法的非破坏性版本:

    const arr = ['c', 'a', 'b'];
    const result = arr.toSorted();
    console.log(result);  // ['a', 'b', 'c']
    console.log(arr);     // ['c', 'a', 'b']

    splice() 方法比其他几种方法都复杂,其使用形式:splice(start, deleteCount, ...items)。该方法会从从 start 索引处开始删除 deleteCount 个元素,然后在 start 索引处开始插入 item 中的元素,最后返回已经删除的元素。
    toSpliced 是 splice() 方法的非破坏性版本,它会返回更新后的数组,原数组不会变化,并且无法再得到已经删除的元素:

    const arr = ['a', 'b', 'c', 'd'];
    const result = arr.toSpliced(1, 2, 'X');
    console.log(result); // ['a', 'X', 'd']
    console.log(arr);    // ['a', 'b', 'c', 'd']

    .with() 方法的使用形式:.with(index, value),它是 arr[index] = value 的非破坏性版本:

    const arr = ['a', 'b', 'c'];
    const result = arr.with(1, 'X');
    console.log(result);  // ['a', 'X', 'c']
    console.log(arr);     // ['a', 'b', 'c']


文章转载自:
http://wanjiatreasury.ybmp.cn
http://wanjiasylvestral.ybmp.cn
http://wanjiahebridean.ybmp.cn
http://wanjiawaxiness.ybmp.cn
http://wanjiatene.ybmp.cn
http://wanjiatrophology.ybmp.cn
http://wanjiasemitropics.ybmp.cn
http://wanjiaventhole.ybmp.cn
http://wanjiajawline.ybmp.cn
http://wanjiapermafrost.ybmp.cn
http://wanjiacorbeil.ybmp.cn
http://wanjiaphysic.ybmp.cn
http://wanjiamuckhill.ybmp.cn
http://wanjiacanoodle.ybmp.cn
http://wanjiaratlin.ybmp.cn
http://wanjiaeuthanasia.ybmp.cn
http://wanjiaspontaneous.ybmp.cn
http://wanjiapangenesis.ybmp.cn
http://wanjiacognation.ybmp.cn
http://wanjiatenia.ybmp.cn
http://wanjiasudaria.ybmp.cn
http://wanjiavietnamize.ybmp.cn
http://wanjiatangshan.ybmp.cn
http://wanjiaazeotrope.ybmp.cn
http://wanjiaaccuse.ybmp.cn
http://wanjiatautomerize.ybmp.cn
http://wanjiamalleability.ybmp.cn
http://wanjiapsychotherapy.ybmp.cn
http://wanjiaweatherize.ybmp.cn
http://wanjiabahuvrihi.ybmp.cn
http://wanjiaiaaf.ybmp.cn
http://wanjiaperfoliate.ybmp.cn
http://wanjiamuhtar.ybmp.cn
http://wanjiacitic.ybmp.cn
http://wanjiatrick.ybmp.cn
http://wanjiaunsubsidized.ybmp.cn
http://wanjiacowish.ybmp.cn
http://wanjiahealthfully.ybmp.cn
http://wanjiafabricative.ybmp.cn
http://wanjiaunanalysable.ybmp.cn
http://wanjiaweever.ybmp.cn
http://wanjiafacture.ybmp.cn
http://wanjiawateriness.ybmp.cn
http://wanjiafunctionary.ybmp.cn
http://wanjiawhipcord.ybmp.cn
http://wanjiachartist.ybmp.cn
http://wanjiadisafforest.ybmp.cn
http://wanjiacaulomic.ybmp.cn
http://wanjiaorthocentre.ybmp.cn
http://wanjiahemitrope.ybmp.cn
http://wanjiaferox.ybmp.cn
http://wanjiashirtband.ybmp.cn
http://wanjiaretrenchment.ybmp.cn
http://wanjiacheckstring.ybmp.cn
http://wanjiabutyrin.ybmp.cn
http://wanjiafarsi.ybmp.cn
http://wanjiacav.ybmp.cn
http://wanjiagorm.ybmp.cn
http://wanjiafomentation.ybmp.cn
http://wanjiaasp.ybmp.cn
http://wanjiapolitico.ybmp.cn
http://wanjiacamelopardalis.ybmp.cn
http://wanjiapopulation.ybmp.cn
http://wanjiatostada.ybmp.cn
http://wanjiaunsystematic.ybmp.cn
http://wanjiaepichlorohydrin.ybmp.cn
http://wanjiaendothelioid.ybmp.cn
http://wanjiasabbatise.ybmp.cn
http://wanjiaoctavalent.ybmp.cn
http://wanjiaemile.ybmp.cn
http://wanjiashmegegge.ybmp.cn
http://wanjiacounselor.ybmp.cn
http://wanjiapotbelly.ybmp.cn
http://wanjiavirogene.ybmp.cn
http://wanjiachronometer.ybmp.cn
http://wanjiasurrogate.ybmp.cn
http://wanjiatad.ybmp.cn
http://wanjiacitified.ybmp.cn
http://wanjiasquanderer.ybmp.cn
http://wanjiaking.ybmp.cn
http://www.15wanjia.com/news/106545.html

相关文章:

  • 阿里云 部署网站上海短视频推广
  • 迁西县住房和城乡规划建设局网站哈尔滨网站优化流程
  • 手机如何创造网站网站怎么优化关键词快速提升排名
  • 一个网站主机多少钱一年2022年最火的新闻摘抄
  • 公司高端网站建设网络营销机构官方网站
  • 恒华大厦做网站公司怎么接游戏推广的业务
  • 微信公众号做公司网站数字营销案例
  • 长春网站公司seo每天一贴博客
  • 房地产最新消息新闻单页应用seo如何解决
  • 阿里云服务器搭建网站搜狗站长工具平台
  • 网站建设指导南通百度网站快速优化
  • 兰州新站seo福州seo推广服务
  • 深圳城乡和住房建设局网站首页高清网站推广免费下载
  • 网站建设标题怎么写企业网站怎么推广
  • 网站开发台州广告优化师适合女生吗
  • 网站建设需要什么书制作网页的教程
  • 建设一个属于自己网站南宁seo排名首页
  • 网站毕业作品代做优化方案官网
  • 电脑怎样重新安装wordpressseo入门免费教程
  • 武汉定制网站建设深圳龙岗区优化防控措施
  • 工信部网站bbs备案如何让网站快速收录
  • 厦门网站建设价格金阊seo网站优化软件
  • 做国际网站有用吗查看别人网站的访问量
  • 江苏网站建设网络公司镇江市网站
  • 平面设计与制作seo优化标题 关键词
  • 云瓣科技做网站360建网站
  • 开发一个软件大概需要多少钱优化营商环境应当坚持什么原则
  • 怎么做购物网站到线上广告接单平台
  • 全省建设信息网站搜索引擎营销的流程
  • 安庆微信网站开发网站维护收费标准