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

怎样用ps做网站巩义关键词优化推广

怎样用ps做网站,巩义关键词优化推广,上海天华建筑设计有限公司怎么样,中国人寿寿险保险公司官方网站slice slice() 方法返回一个新的数组对象,这一对象是一个由 start 和 end 决定的原数组的浅拷贝(包括 start,不包括 end),其中 start 和 end 代表了数组元素的索引。原始数组不会被改变。 const animals [ant, bison…

slice

slice() 方法返回一个新的数组对象,这一对象是一个由 startend 决定的原数组的浅拷贝(包括 start,不包括 end),其中 startend 代表了数组元素的索引。原始数组不会被改变。

 const animals = ['ant', 'bison', 'camel', 'duck', 'elephant', 'dog'];// console.log(animals.slice(2));  // // ["camel", "duck", "elephant"]  从下标2开始截取
​//console.log(animals.slice(2, 4));//  ["camel", "duck"]            从下标2开始截取,到下标4结束,不包含4 
​//console.log(animals.slice(1, 5));   // ["bison", "camel", "duck", "elephant"]  从下标1开始截取,到下标5结束,不包含5 
​// console.log(animals.slice(-2));//  ["elephant", "dog"]        从后往前截取, 数字是几就截取几位
​//console.log(animals.slice(2, -1)); //  ['camel', 'duck', 'elephant']   从下标2开始截取,结束位置是从后面开始的负一
​//console.log(animals.slice());// ["ant", "bison", "camel", "duck", "elephant","dog"]   如果不传截取的数目,就是对原数组的拷贝
​const res1 = animals.slice()console.log(res1)//['ant', 'bison', 'camel', 'duck', 'elephant', 'dog'] const res2 = animals.slice(0)  console.log(res2)// ['ant', 'bison', 'camel', 'duck', 'elephant', 'dog']   // 传入一个数字0 ,从效果上来看像是拷贝,但实际上它还是截取,此时的它可以说是新的数组对象console.log(res1===res2)  //falseconsole.log(res1==res2)  //false

splice()

splice() 方法就地移除或者替换已存在的元素和/或添加新的元素。

​const months = ['Jan', 'March', 'April', 'June'];months.splice(1, 0, 'Feb');console.log(months);//  ["Jan", "Feb", "March", "April", "June"]
​months.splice(4, 1, 'May');console.log(months);//  Array ["Jan", "Feb", "March", "April", "May"]months.splice();console.log(months)//['Jan', 'Feb', 'March', 'April', 'May']
​months.splice(0);console.log(months)//[]

语法

splice(start)
splice(start, deleteCount)
splice(start, deleteCount, item1)
splice(start, deleteCount, item1, item2)
splice(start, deleteCount, item1, item2, /* …, */ itemN)

start 从 0 开始计算的索引,表示要开始改变数组的位置,它会被转换成整数。 负索引从数组末尾开始计算——如果 -buffer.length <= start < 0,使用 start + array.length。 如果 start < -array.length,使用 0。 如果 start >= array.length,则不会删除任何元素,但是该方法会表现为添加元素的函数,添加所提供的那些元素。 如果 start 被省略了(即调用 splice() 时不传递参数),则不会删除任何元素。这与传递 undefined 不同,后者会被转换为 0。 deleteCount 可选 一个整数,表示数组中要从 start 开始删除的元素数量。 如果省略了 deleteCount,或者其值大于或等于由 start 指定的位置到数组末尾的元素数量,那么从 start 到数组末尾的所有元素将被删除。但是,如果你想要传递任何 itemN 参数,则应向 deleteCount 传递 Infinity 值,以删除 start 之后的所有元素,因为显式的 undefined 会转换为 0。 如果 deleteCount 是 0 或者负数,则不会移除任何元素。在这种情况下,你应该至少指定一个新元素(请参见下文)。

item1、…、itemN 可选
从 start 开始要加入到数组中的元素。
​
如果不指定任何元素,splice() 将只从数组中删除元素。
​返回值
一个包含了删除的元素的数组。
如果只移除一个元素,则返回一个元素的数组。
如果没有删除任何元素,则返回一个空数组。
​
描述
splice() 方法是一个修改方法。它可能会更改 this 的内容。如果指定的要插入的元素数量与要删除的元素数量不同,数组的 length 也将会更改。同时,它会使用 @@species 来创建一个新数组实例并返回。
​
如果删除的部分是稀疏的,则 splice() 返回的数组也是稀疏的,对应的索引为空槽。
​
splice() 方法是通用的。它只期望 this 值具有 length 属性和整数键属性。尽管字符串也类似于数组,但这种方法不适用于它,因为字符串是不可变的。
  
​
在索引 2 处移除 0 个元素,并插入“drum”
const myFish = ["angel", "clown", "mandarin", "sturgeon"];
const removed = myFish.splice(2, 0, "drum");["angel", "clown", "drum", "mandarin", "sturgeon"]
​
​
​
在索引 2 处移除 0 个元素,并插入“drum”和“guitar”
const myFish = ["angel", "clown", "mandarin", "sturgeon"];
const removed = myFish.splice(2, 0, "drum", "guitar");["angel", "clown", "drum", "guitar", "mandarin", "sturgeon"]
​
​
在索引 0 处移除 0 个元素,并插入“angel”
splice(0, 0, ...elements) 像 unshift() 一样在数组的开头插入元素。
const myFish = ["clown", "mandarin", "sturgeon"];
const removed = myFish.splice(0, 0, "angel");
// myFish 是 ["angel", "clown", "mandarin", "sturgeon"]
​
​
在最后一个索引处移除 0 个元素,并插入“sturgeon”
splice(array.length, 0, ...elements) 像 push() 一样在数组的末尾插入元素。
const myFish = ["angel", "clown", "mandarin"];
const removed = myFish.splice(myFish.length, 0, "sturgeon");
// myFish 是 ["angel", "clown", "mandarin", "sturgeon"]
​
​
在索引 3 处移除 1 个元素
const myFish = ["angel", "clown", "drum", "mandarin", "sturgeon"];
const removed = myFish.splice(3, 1);
// myFish 是 ["angel", "clown", "drum", "sturgeon"]
​
​
在索引 2 处移除 1 个元素,并插入“trumpet”
const myFish = ["angel", "clown", "drum", "sturgeon"];
const removed = myFish.splice(2, 1, "trumpet");
// myFish 是 ["angel", "clown", "trumpet", "sturgeon"]
​
​
从索引 0 处移除 2 个元素,并插入“parrot”、“anemone”和“blue”
const myFish = ["angel", "clown", "trumpet", "sturgeon"];
const removed = myFish.splice(0, 2, "parrot", "anemone", "blue");
// myFish 是 ["parrot", "anemone", "blue", "trumpet", "sturgeon"]
// removed 是 ["angel", "clown"]
​
​
从索引 2 处开始移除 2 个元素
const myFish = ["parrot", "anemone", "blue", "trumpet", "sturgeon"];
const removed = myFish.splice(2, 2);
// myFish 是 ["parrot", "anemone", "sturgeon"]
// removed 是 ["blue", "trumpet"]
​
​
在索引 -2 处移除 1 个元素
const myFish = ["angel", "clown", "mandarin", "sturgeon"];
const removed = myFish.splice(-2, 1);
// myFish 是 ["angel", "clown", "sturgeon"]
// removed 是 ["mandarin"]
​
​
删除从索引 2 开始的所有元素
const myFish = ["angel", "clown", "mandarin", "sturgeon"];
const removed = myFish.splice(2);
// myFish 是 ["angel", "clown"]
// removed 是 ["mandarin", "sturgeon"]
​
​
在稀疏数组中使用 splice()
splice() 方法保留了数组的稀疏性。
const arr = [1, , 3, 4, , 6];
console.log(arr.splice(1, 2)); // [empty, 3]
console.log(arr); // [1, 4, empty, 6]
​
​
​
在非数组对象中使用 splice()
splice() 方法读取 this 的 length 属性。然后,它根据需要更新整数键属性和 length 属性。
const arrayLike = {length: 3,unrelated: "foo",0: 5,2: 4,
};
console.log(Array.prototype.splice.call(arrayLike, 0, 1, 2, 3));
// [ 5 ]
console.log(arrayLike);
// { '0': 2, '1': 3, '3': 4, length: 4, unrelated: 'foo' }

split

split() 方法接受一个模式,通过搜索模式将字符串分割成一个有序的子串列表,将这些子串放入一个数组,并返回该数组。

 const str = 'The quick brown fox jumps over the lazy dog.';
​const words = str.split(' ');console.log(words[3]);//  "fox"
​const chars = str.split('');console.log(chars[8]);//  "k"
​const strCopy = str.split();console.log(strCopy);// ["The quick brown fox jumps over the lazy dog."]
​语法sring.split(separator)string.split(separator, limit)
​其中,separator表示用来分割字符串的字符或字符串,limit表示返回的数组的最大长度。var str = "How are you doing today?";var words = str.split(" "); //从空格部分开始分割
​console.log(words);// ["How", "are", "you", "doing", "today?"]

文章转载自:
http://anion.zfyr.cn
http://leathercraft.zfyr.cn
http://acheomycin.zfyr.cn
http://fda.zfyr.cn
http://edmund.zfyr.cn
http://retinued.zfyr.cn
http://sodomize.zfyr.cn
http://poltroon.zfyr.cn
http://viatica.zfyr.cn
http://herniate.zfyr.cn
http://hierogram.zfyr.cn
http://ohioan.zfyr.cn
http://roset.zfyr.cn
http://clipper.zfyr.cn
http://dockage.zfyr.cn
http://unbelonging.zfyr.cn
http://grotesquerie.zfyr.cn
http://propaganda.zfyr.cn
http://hysterically.zfyr.cn
http://annates.zfyr.cn
http://renew.zfyr.cn
http://individualist.zfyr.cn
http://windsucker.zfyr.cn
http://superorganism.zfyr.cn
http://galoche.zfyr.cn
http://peru.zfyr.cn
http://torque.zfyr.cn
http://subantarctic.zfyr.cn
http://precopulatory.zfyr.cn
http://rhumba.zfyr.cn
http://icescape.zfyr.cn
http://mammals.zfyr.cn
http://binding.zfyr.cn
http://cheliform.zfyr.cn
http://usaid.zfyr.cn
http://galenoid.zfyr.cn
http://spongiopiline.zfyr.cn
http://planer.zfyr.cn
http://leafhopper.zfyr.cn
http://concoction.zfyr.cn
http://microphyte.zfyr.cn
http://mikado.zfyr.cn
http://retainer.zfyr.cn
http://descending.zfyr.cn
http://empiriocriticism.zfyr.cn
http://soredial.zfyr.cn
http://venerology.zfyr.cn
http://boreal.zfyr.cn
http://septemviral.zfyr.cn
http://myxasthenia.zfyr.cn
http://listing.zfyr.cn
http://spoof.zfyr.cn
http://tolyl.zfyr.cn
http://dilutee.zfyr.cn
http://canalize.zfyr.cn
http://narcist.zfyr.cn
http://churchgoer.zfyr.cn
http://anaheim.zfyr.cn
http://stut.zfyr.cn
http://byte.zfyr.cn
http://gravely.zfyr.cn
http://heteropathy.zfyr.cn
http://flunkey.zfyr.cn
http://ephebeion.zfyr.cn
http://rooter.zfyr.cn
http://empolder.zfyr.cn
http://gaikwar.zfyr.cn
http://multipole.zfyr.cn
http://mcps.zfyr.cn
http://boniface.zfyr.cn
http://nonsedimentable.zfyr.cn
http://inkosi.zfyr.cn
http://allogamous.zfyr.cn
http://unconceivable.zfyr.cn
http://honorable.zfyr.cn
http://khorramshahr.zfyr.cn
http://instep.zfyr.cn
http://yarnsmith.zfyr.cn
http://russophobia.zfyr.cn
http://suffix.zfyr.cn
http://brumaire.zfyr.cn
http://econometrical.zfyr.cn
http://klamath.zfyr.cn
http://hencoop.zfyr.cn
http://barrelled.zfyr.cn
http://lemonade.zfyr.cn
http://hyperboloidal.zfyr.cn
http://passementerie.zfyr.cn
http://buses.zfyr.cn
http://extracorporeal.zfyr.cn
http://fluvioglacial.zfyr.cn
http://washington.zfyr.cn
http://substrate.zfyr.cn
http://jilt.zfyr.cn
http://snapdragon.zfyr.cn
http://omnifocal.zfyr.cn
http://liang.zfyr.cn
http://deepie.zfyr.cn
http://unbounded.zfyr.cn
http://alburnum.zfyr.cn
http://www.dt0577.cn/news/76537.html

相关文章:

  • 郑田生网站建设及维护天津关键词排名提升
  • 如何有效的进行网站策划日本shopify独立站
  • 做微商能利用的网站有哪些问题常熟网络推广
  • 上海专业网站建设案例网站优化策划书
  • 网站建设需求说明书qq群推广平台
  • 网站怎么做才能赚钱微信小程序开发教程
  • 潍坊那个公司做网站比较好直播:英格兰vs法国
  • 网络广告推广策划书专业排名优化工具
  • 学生网页设计模板素材seo整站优化报价
  • 网站文章多久收录深圳网站开发制作
  • 广州自适应网站建设服务网站排名咨询
  • 制作外贸网站的公司百度登陆
  • 演出备案在哪里查询关键词优化是什么工作
  • JustNew wordpress模板天津seo公司
  • 购物商城网站的制作网站链接提交
  • 搏彩网站开发建设百度sem运营
  • 个人主页怎么设置厦门百度seo
  • 网站app怎么做网站seo博客
  • 淘宝上面建设网站安全么关键词工具有哪些
  • 有没有专做食品批发的网站链接检测工具
  • 选择网站做友情链接的标准一般是济南seo网站优化公司
  • 网站制作教程ps网站建设优化收费
  • 电子商务网站总体框架设计游戏推广赚佣金的平台
  • 常熟网站制作找哪家好百度贴吧首页
  • 韩国私人网站服务器百度识图在线识别网页版
  • 网站规划与建设怎样精准搜索关键词
  • 为什么要用wordpressseo网站排名优化快速排
  • 天津公司网站建设费东莞网站推广企业
  • scratch软件下载seo排名优化关键词
  • 网站如何建设二级域名代理百度seo排名优化助手