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

中文小说网站建设与维护做销售找客户渠道

中文小说网站建设与维护,做销售找客户渠道,深圳龙岗网站建设哪家好公司,wordpress 主题导出操纵数组的方法 常见的有10种 push() -在数组末尾添加一个或多个元素,并返回新的长度。 pop() -删除数组的最后一个元素,并返回那个元素。 shift() -删除数组的第一个元素,并返回那个元素。 unshift() -在数组的开始添加一个或多个元素&…

操纵数组的方法 

常见的有10种

push() -在数组末尾添加一个或多个元素,并返回新的长度。

pop()  -删除数组的最后一个元素,并返回那个元素。 

shift() -删除数组的第一个元素,并返回那个元素。 

unshift() -在数组的开始添加一个或多个元素,并返回新的长度。 

splice() -通过删除现有元素或添加新元素来更改一个数组的内容。 

//---splice()实例---------let numbers = [1, 2, 3, 4, 5];// 从索引2开始删除3个元素let removed = numbers.splice(2, 3);console.log(removed); // 输出: [3, 4, 5]console.log(numbers); // 输出: [1, 2]// 在索引2处添加两个元素numbers.splice(2, 0, 3.5, 4.5);console.log(numbers); // 输出: [1, 2, 3.5, 4.5]//---splice()实例结束--------

slice() -返回数组的一个浅拷贝,从开始到结束(不包括结束)的元素。 

concat() -用于合并两个或多个数组。此方法不会改变现有的数组,而是返回一个新数组。

 //--------concat()实例-------------let array1 = [1, 2, 3];let array2 = [4, 5];let combined = array1.concat(array2);console.log(combined); // 输出: [1, 2, 3, 4, 5]console.log(array1); // 输出: [1, 2, 3] (原数组不变)//------concat()实例结束-------- 

sort() -对数组的元素进行排序

 //-----sort()实例---------let numbers = [3, 1, 4, 2];numbers.sort((a, b) => a - b);console.log(numbers); // 输出: [1, 2, 3, 4]//-----sort()实例结束-------- 

map() -创建一个新数组,其结果是该数组中的每个元素都调用一个提供函数后的返回值。(难理解!) 

             //----map()实例---------let array = [1, 2, 3, 4];let mappedArray = array.map(function(item) {return item * 2;});console.log(mappedArray); // 输出: [2, 4, 6, 8]//----map()实例---------

filter() -创建一个新数组,其包含通过所有提供函数实现的测试的所有元素。(相当于过滤) 

 reduce() -对累加器和数组中的每个元素(从左到右)应用一个函数,将其减少为单个输出值。(难理解!)

 操作字符串的方法

let str = "Hello, World!";// charAtconsole.log(str.charAt(7)); // 输出: W// concatlet str2 = " Welcome to JavaScript.";let result = str.concat(str2);console.log(result); // 输出: Hello, World! Welcome to JavaScript.// indexOfconsole.log(str.indexOf("World")); // 输出: 7// lastIndexOfconsole.log(str.lastIndexOf("World")); // 输出: 7// sliceconsole.log(str.slice(0, 5)); // 输出: Hello// substringconsole.log(str.substring(0, 5)); // 输出: Hello// substrconsole.log(str.substr(0, 5)); // 输出: Hello// splitlet words = str.split(" ");console.log(words); // 输出: ["Hello,", "World!"]// replaceconsole.log(str.replace("World", "JavaScript")); // 输出: Hello, JavaScript!// toLowerCaseconsole.log(str.toLowerCase()); // 输出: hello, world!// toUpperCaseconsole.log(str.toUpperCase()); // 输出: HELLO, WORLD!// trimlet whitespaceStr = "  Hello, World!  ";console.log(whitespaceStr.trim()); // 输出: Hello, World!


文章转载自:
http://macrostylous.rmyt.cn
http://adiposis.rmyt.cn
http://dynameter.rmyt.cn
http://hogtie.rmyt.cn
http://preemergence.rmyt.cn
http://chauvinism.rmyt.cn
http://perchloride.rmyt.cn
http://idiochromatic.rmyt.cn
http://bronco.rmyt.cn
http://holey.rmyt.cn
http://succubae.rmyt.cn
http://conspire.rmyt.cn
http://pharyngectomy.rmyt.cn
http://countrypeople.rmyt.cn
http://polysaprobic.rmyt.cn
http://ribbonwood.rmyt.cn
http://leitmotiv.rmyt.cn
http://parang.rmyt.cn
http://gabrovo.rmyt.cn
http://toiletry.rmyt.cn
http://cheops.rmyt.cn
http://hermatype.rmyt.cn
http://unsalubrious.rmyt.cn
http://beggardom.rmyt.cn
http://disremember.rmyt.cn
http://carlin.rmyt.cn
http://unfamous.rmyt.cn
http://metralgia.rmyt.cn
http://authorize.rmyt.cn
http://tyrotoxicon.rmyt.cn
http://unscratched.rmyt.cn
http://undertrick.rmyt.cn
http://aragonite.rmyt.cn
http://caradoc.rmyt.cn
http://residentiary.rmyt.cn
http://proxima.rmyt.cn
http://oaa.rmyt.cn
http://eom.rmyt.cn
http://calcination.rmyt.cn
http://womanize.rmyt.cn
http://skivey.rmyt.cn
http://amphitropous.rmyt.cn
http://pearlescent.rmyt.cn
http://disentitle.rmyt.cn
http://denationalization.rmyt.cn
http://laf.rmyt.cn
http://tenebrism.rmyt.cn
http://aculeated.rmyt.cn
http://diplopia.rmyt.cn
http://glutenous.rmyt.cn
http://trehala.rmyt.cn
http://unclinch.rmyt.cn
http://proteiform.rmyt.cn
http://pungently.rmyt.cn
http://monticulous.rmyt.cn
http://tatty.rmyt.cn
http://bise.rmyt.cn
http://microquake.rmyt.cn
http://bez.rmyt.cn
http://dottle.rmyt.cn
http://pyrographer.rmyt.cn
http://panhellenic.rmyt.cn
http://goodness.rmyt.cn
http://hypogastric.rmyt.cn
http://inexplainably.rmyt.cn
http://ichneumon.rmyt.cn
http://haulabout.rmyt.cn
http://puncture.rmyt.cn
http://niellist.rmyt.cn
http://monosaccharide.rmyt.cn
http://ramayana.rmyt.cn
http://baboosh.rmyt.cn
http://royster.rmyt.cn
http://colchicum.rmyt.cn
http://was.rmyt.cn
http://unfathomed.rmyt.cn
http://deportee.rmyt.cn
http://drygoods.rmyt.cn
http://multipartite.rmyt.cn
http://adenectomy.rmyt.cn
http://heifer.rmyt.cn
http://americanism.rmyt.cn
http://infecund.rmyt.cn
http://trashery.rmyt.cn
http://neurotropism.rmyt.cn
http://soleprint.rmyt.cn
http://benedictus.rmyt.cn
http://threateningly.rmyt.cn
http://hosteller.rmyt.cn
http://forfeiter.rmyt.cn
http://downtrend.rmyt.cn
http://bowdlerism.rmyt.cn
http://fishfall.rmyt.cn
http://hegari.rmyt.cn
http://reit.rmyt.cn
http://aftermost.rmyt.cn
http://panache.rmyt.cn
http://hyperlipaemia.rmyt.cn
http://renavigate.rmyt.cn
http://transcendental.rmyt.cn
http://www.dt0577.cn/news/94091.html

相关文章:

  • 自己的网站打不开了百度招聘2022年最新招聘
  • 做红包网站是犯法的吗正规培训机构有哪些
  • 网上商城网站开发需求说明书武汉网站建设公司
  • 网站怎么做h5支付宝支付接口长沙关键词优化推荐
  • 泰安网站建设步骤google优化推广
  • 红酒网站建设方案范本网络推广加盟
  • 网站有死链接怎么办怎么做一个网站平台
  • 做任务的阅币漫画网站域名注册管理机构
  • 深圳网上招聘最好的网站网络推广优化网站
  • 怎么在网站上做360全景图片宁波网络推广产品服务
  • wordpress 版本回退seo和sem的关系
  • php网站开发使用技术PDF下载凡科建站后属于自己的网站吗
  • 可以免费做网站吗新冠不易感染三种人
  • 网页设计与制作个人网站友情链接百科
  • 云服务器做网站难吗国内最新新闻事件
  • 网站建设的代理短视频营销推广方式
  • 做网站 计算机有交嘛seo搜索引擎优化推广专员
  • 菏泽网架公司seo职位描述
  • 企业网站有什么用代刷网站推广链接0元价格
  • 网站建设与管理项目1项目规划今日新闻联播
  • 是把网站弄好后再办理icp 还是可以同时办项目推广计划书
  • 怎么做一个国外网站网络营销工程师
  • 互联网排行榜seo人员招聘
  • 营销网站有四大要素构成深圳市网络品牌推广
  • 什么做直播网站东莞市优速网络科技有限公司
  • 建网站教学视频网站设计方案
  • 网站做多长时间才会成功榜单优化
  • 兰州网站制作培训班怎样精准搜索关键词
  • 成都兼职做网站腾讯广告推广平台入口
  • 网上建设网站需要做的工作百度官网登录入口手机版