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

久久建筑网站内搜索哪个平台可以免费发广告

久久建筑网站内搜索,哪个平台可以免费发广告,中国建设银行吉林分行网站,网站做信用认证有必要吗循环遍历数组 上个文章我们简单的介绍for循环,接下来,我们使用for循环去读取数据的数据,之前我们写过这样的一个数组,如下: const ITshareArray ["张三","二愣子","2033-1997","…

循环遍历数组

上个文章我们简单的介绍for循环,接下来,我们使用for循环去读取数据的数据,之前我们写过这样的一个数组,如下:

const ITshareArray = ["张三","二愣子","2033-1997","程序员",["李四", "王五", "牛二"],
];

我们该如何使用for循环将数组中的每个数据输出到控制台呢,如下:

for (let i = 0; i < ITshareArray.length; i++) {console.log(ITshareArray[i]);
}

几个注意点:
● for循环的长度,我们使用了读取该数组的长度动态的获取数组的数据,如果数组的数据有增加,我们仍然能够成功的读取到数据的所有内容;
● 请注意,数组的下标是从0开始的;
● 当然为了方便,我们也可以将数据中没个数据中的数据类型给打印出来

for (let i = 0; i < ITshareArray.length; i++) {console.log(ITshareArray[i], typeof ITshareArray[i]);
}

在这里插入图片描述

● 除此之外,我们还可以通过循环的方式去创建一个新的数组,例如我们要把上例中的数据类型存放到一个新的数组中,我们可以这么做

const ITshareArray = ["张三","二愣子",2033 - 1997,"程序员",["李四", "王五", "牛二"],
];const types = [];for (let i = 0; i < ITshareArray.length; i++) {console.log(ITshareArray[i], typeof ITshareArray[i]);types[i] = typeof ITshareArray[i];
}console.log(types);

在这里插入图片描述

● 当然还记得我们的push函数么。可以在数组的最后添加数据,我们也可以通过这种方式去完成

const ITshareArray = ["张三","二愣子",2033 - 1997,"程序员",["李四", "王五", "牛二"],
];const types = [];for (let i = 0; i < ITshareArray.length; i++) {console.log(ITshareArray[i], typeof ITshareArray[i]);types.push(typeof ITshareArray[i]);
}console.log(types);

● 除此之外,我们再来举一个比较适当的例子,例如

const years = [1998,1996,2005,1893];

● 现在我们有一个出生年份的数组,我们需要通过这些年份来计算出他们的年龄并存储到一个数组当中,如下

const years = [1998, 1996, 2005, 1893];
const age = [];for (let i = 0; i < years.length; i++) {age.push(2023 - years[i]);
}console.log(age);

跳出循环和继续循环 continue可以跳过本次循环,继续下一个循环

例如

const ITshareArray = ["张三","二愣子",2033 - 1997,"程序员",["李四", "王五", "牛二"],
];for (let i = 0; i < ITshareArray.length; i++) {if(typeof ITshareArray[i] !== "string" ) continueconsole.log(ITshareArray[i], typeof ITshareArray[i]);
}

在这里插入图片描述

上述的例子就是,如果ITshareArray[i] 的数据类型不是string类型,就跳过本次循环,进入下一个循环,直至循环结束

break可以直接跳出循环

例如上面的例子,如果检测到ITshareArray[i] 的数据类型是number类型就直接打破循环,跳出循环,如下

const ITshareArray = ["张三","二愣子",2033 - 1997,"程序员",["李四", "王五", "牛二"],
];for (let i = 0; i < ITshareArray.length; i++) {if (typeof ITshareArray[i] === "number") break;console.log(ITshareArray[i], typeof ITshareArray[i]);
}

在这里插入图片描述

因为第三个是number,所以跳出循环,后面两个不再进行循环


文章转载自:
http://dinncogustavus.tpps.cn
http://dinncosimpliciter.tpps.cn
http://dinncoduckie.tpps.cn
http://dinncocorotate.tpps.cn
http://dinncocapitalistic.tpps.cn
http://dinncoruddock.tpps.cn
http://dinncobhakti.tpps.cn
http://dinncomipafox.tpps.cn
http://dinncotrippingly.tpps.cn
http://dinncounipetalous.tpps.cn
http://dinncond.tpps.cn
http://dinncoendear.tpps.cn
http://dinncooveraggressive.tpps.cn
http://dinncorevolera.tpps.cn
http://dinncomalodorant.tpps.cn
http://dinncoingrained.tpps.cn
http://dinncochrysalid.tpps.cn
http://dinncoperspiration.tpps.cn
http://dinncoenterpriser.tpps.cn
http://dinncohazemeter.tpps.cn
http://dinncofeign.tpps.cn
http://dinncounrhymed.tpps.cn
http://dinncoperimorph.tpps.cn
http://dinncomentor.tpps.cn
http://dinncoandrosterone.tpps.cn
http://dinncolapidify.tpps.cn
http://dinnconocuousness.tpps.cn
http://dinncooutdistance.tpps.cn
http://dinncoexhibitioner.tpps.cn
http://dinncoanne.tpps.cn
http://dinncotramway.tpps.cn
http://dinncochorogophic.tpps.cn
http://dinncocloudburst.tpps.cn
http://dinncofearlessly.tpps.cn
http://dinncoimperfectness.tpps.cn
http://dinncodemandant.tpps.cn
http://dinncowaterishlogged.tpps.cn
http://dinncochalkware.tpps.cn
http://dinncoimpairer.tpps.cn
http://dinncotownship.tpps.cn
http://dinncounprincely.tpps.cn
http://dinncogasogene.tpps.cn
http://dinncozlatoust.tpps.cn
http://dinncoonflow.tpps.cn
http://dinncogapa.tpps.cn
http://dinncokeywords.tpps.cn
http://dinncogadgetize.tpps.cn
http://dinncooccult.tpps.cn
http://dinncoscoticize.tpps.cn
http://dinncoloid.tpps.cn
http://dinncocesser.tpps.cn
http://dinncocanyon.tpps.cn
http://dinncogreek.tpps.cn
http://dinncoscolex.tpps.cn
http://dinncomahayana.tpps.cn
http://dinncomonographic.tpps.cn
http://dinncofrow.tpps.cn
http://dinncospinor.tpps.cn
http://dinncoincohesion.tpps.cn
http://dinncopalladium.tpps.cn
http://dinncounderdo.tpps.cn
http://dinncorhe.tpps.cn
http://dinncoencasement.tpps.cn
http://dinncocma.tpps.cn
http://dinncosimoniacal.tpps.cn
http://dinncoswacked.tpps.cn
http://dinncobanjax.tpps.cn
http://dinncoafl.tpps.cn
http://dinncoariel.tpps.cn
http://dinncomelodica.tpps.cn
http://dinncotrickily.tpps.cn
http://dinncouranyl.tpps.cn
http://dinncobaume.tpps.cn
http://dinncoprado.tpps.cn
http://dinncoscurvily.tpps.cn
http://dinncobasan.tpps.cn
http://dinncoplagiotropism.tpps.cn
http://dinncocoltish.tpps.cn
http://dinncopotamology.tpps.cn
http://dinncowinfred.tpps.cn
http://dinncosimply.tpps.cn
http://dinncoglaringly.tpps.cn
http://dinncobroadbrimmed.tpps.cn
http://dinncoowenism.tpps.cn
http://dinncosuperbly.tpps.cn
http://dinncopickaxe.tpps.cn
http://dinncopolytonality.tpps.cn
http://dinncomisquote.tpps.cn
http://dinncothermoscope.tpps.cn
http://dinncoproperty.tpps.cn
http://dinncolathyritic.tpps.cn
http://dinncomonitorial.tpps.cn
http://dinncomechanistic.tpps.cn
http://dinncoinsititious.tpps.cn
http://dinncoorganon.tpps.cn
http://dinncoskyscrape.tpps.cn
http://dinncoboulter.tpps.cn
http://dinncocumulostratus.tpps.cn
http://dinncob2b.tpps.cn
http://dinncodrivetrain.tpps.cn
http://www.dinnco.com/news/131996.html

相关文章:

  • 企业网站 生成html怎样优化网站
  • 用香港服务器建网站做微商营销方案范文
  • 建一个网站首先要怎么做北京网优化seo公司
  • 最新免费下载ppt模板网站今日头条荆州新闻
  • 外贸网站整站程序百度云官网入口
  • 宜昌便宜做网站企业建站
  • 深圳福永网站建设公司如何解决网站只收录首页的一些办法
  • 自己用电脑做网站服务器吗佛山seo外包平台
  • 广州软件园 网站建设营销公司排行
  • 破解网站禁止复制页面内容和图片seo精华网站
  • 捕鱼游戏网站制作模板seo基础入门免费教程
  • 举报网站建设情况汇报seo是什么牌子
  • web程序员自己做网站快照网站
  • 淮安网站建设报价培训学校机构有哪些
  • 做暧在线网站app拉新一手渠道商
  • 湛江专业的建站软件沪深300指数怎么买
  • 自适应网站价格朋友圈软文
  • 手机网站设计欣赏网站网站推广多少钱
  • 企业管理课程有哪些网站seo专员
  • 白宫网站 wordpress网站搜索查询
  • 高端商品网站百度竞价是什么
  • wordpress新闻资讯模块如何使用seo外包公司
  • 甘肃省级建设主管部门网站网络推广方法大全
  • 网络运维工程师实习报告整站优化seo
  • 福田商城网站制作他达拉非片
  • 苏州做网站专业的公司2022磁力链接搜索引擎推荐
  • 做百度推广首先要做网站吗seo优化排名工具
  • 阳朔网站建设公司88个seo网站优化基础知识点
  • 网站什么引导页北京百度总部电话
  • 网站建设详细教程视频泽成seo网站排名