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

带做网站价位网站优化排名易下拉软件

带做网站价位,网站优化排名易下拉软件,上海网站建设熊掌号,做软件的网站建设1.Set 是什么 Set是新的引用型的数据结构 它类似于数组,但是成员的值都是唯一的,没有重复的值。 Set本身是一个构造函数,用来生成 Set 数据结构。 Set函数可以接受一个数组作为参数,用来初始化。 2.Set特性(重点概…

1.Set 是什么

Set是新的引用型的数据结构 它类似于数组,但是成员的值都是唯一的,没有重复的值。

Set本身是一个构造函数,用来生成 Set 数据结构。

Set函数可以接受一个数组作为参数,用来初始化。

2.Set特性(重点概括)

重点

  • 1.成员不能重复
  • 2.属于引用数据类型,可以使用 set instanceof Set 或者 Object.prototype.toString.call(set)判断是否为Set类型
  • 3.可以通过Array.from(set)或者 扩展运算符 [...set]转为数组
  • 4.可以通过new Set(arr)进行数组去重
  • 5.Set的属性和方法 add(),has(),delete(),clear(), size属性
  • 6.引用数据类型比较的是地址是否相等,所以Set可以重复添加对象,因为不同对象地址不一样
  • 7.Set数据类型遍历:forEach(),for...of遍历
  • 8.通过Set实现数组的并集net Set([...arr1,...arr2])、交集(a转为Set,filter遍历b在a的Set中存在has())、差集(a转为Set,遍历b在a的Set中是否不存在)

3.Set基本用法

const set = new Set([1, 2, 3, 4, 4]);
console.log(set); // Set(4) {1, 2, 3, 4}

4.怎么证明Set是新的引用类型的数据结构instanceof或者Object.prototype.toString.call(set)

先想一想 以前怎么判断是数组还是对象的?instanceof或者Object.prototype.toString.call(set)

        let arr = [1,2,3];let obj = {a:1}console.log( arr instanceof Array);//trueconsole.log( obj instanceof Object);//trueconsole.log( Object.prototype.toString.call(arr));//[object Array]console.log( Object.prototype.toString.call(obj));//[object Object]let set = new Set([1,2,3,4]);console.log( set instanceof Set);//trueconsole.log( Set.prototype.toString.call(set));//[object Set]

 5.将Set数据类型转化成数组(通过扩展运算符[...set]或者 Array.from(set))

        let set = new Set([1,2,3,4]);let arr1 = Array.from(set);let arr2 = [...set];console.log(arr1,arr2);//(4) [1, 2, 3, 4]

6.通过Set对数组去重 let arr1 = new Set(arr)

7.Set数据内部判断值的机制

  • Set数据内部判断值的机制:Set 内部判断两个值是否不同,使用的算法它类似于精确相等运算符(===),如5和"5"是两个不同的值 
  • 特殊情况就是NaN的情况:虽然NaN === NaN 返回false(其实NaN == NaN也会返回false),但是在Set数据内部认为相等
        let set = new Set();let a = 5;let b = '5';set.add(a);set.add(b);console.log(Array.from(set))// [5, '5']

8.Set数据结构中两个对象总是不相等的。(因为{} === {} 返回false 其实 {}=={}也是返回false)

let set = new Set();
set.add({});
set.add({});console.log(...set);// 此时有两项 {} {}

9.set实例的属性和方法

  • 属性size
  • 方法 add() delete() has() clear()
  •  遍历方法forEach():Set 结构的实例与数组一样,也拥有forEach方法,用于对每个成员执行某种操作,没有返回值。

10.Set和展开运算符...实现数组的并集 交集 差集

        let arr1 = [1, 2, 3]let arr2 = [4, 3, 2]// 实现交集console.log(new Set([...arr1, ...arr2]));//{1, 2, 3, 4}let c = new Set([...arr1, ...arr2]);let a = new Set(arr1); // 1,2,3let b = new Set(arr2); //4, 3, 2// 实现并集(has()方法和filter()方法结合) console.log(new Set([...a].filter(a => b.has(a))));//{2, 3}// 实现差集(a对于b的差集和b对于a的差集不一样)console.log(new Set([...a].filter(item => !b.has(item))));// 1console.log(new Set([...b].filter(item => !a.has(item))));// 4


文章转载自:
http://dinncobrunt.zfyr.cn
http://dinncoautocross.zfyr.cn
http://dinncobedrock.zfyr.cn
http://dinncoahab.zfyr.cn
http://dinncovitaglass.zfyr.cn
http://dinncothermopenetration.zfyr.cn
http://dinncohematocyte.zfyr.cn
http://dinncoheliotypy.zfyr.cn
http://dinncomalthouse.zfyr.cn
http://dinncocustomshouse.zfyr.cn
http://dinncophenocryst.zfyr.cn
http://dinncotrimonthly.zfyr.cn
http://dinncodystopian.zfyr.cn
http://dinncoslugging.zfyr.cn
http://dinncolacework.zfyr.cn
http://dinncovapoury.zfyr.cn
http://dinncosennight.zfyr.cn
http://dinncopodzolise.zfyr.cn
http://dinncothemis.zfyr.cn
http://dinncoemprise.zfyr.cn
http://dinncocromerian.zfyr.cn
http://dinncohein.zfyr.cn
http://dinncoheteroautotrophic.zfyr.cn
http://dinncopyrographic.zfyr.cn
http://dinncophonemic.zfyr.cn
http://dinncovasospasm.zfyr.cn
http://dinncobackseat.zfyr.cn
http://dinncomorbid.zfyr.cn
http://dinncostraightjacket.zfyr.cn
http://dinncopoikilothermal.zfyr.cn
http://dinncoexecuter.zfyr.cn
http://dinncoafrormosia.zfyr.cn
http://dinncocoquette.zfyr.cn
http://dinncobring.zfyr.cn
http://dinncoballistic.zfyr.cn
http://dinncopyrrhuloxia.zfyr.cn
http://dinncoaphis.zfyr.cn
http://dinncodoublure.zfyr.cn
http://dinncoautocollimator.zfyr.cn
http://dinncoastrand.zfyr.cn
http://dinncoroundness.zfyr.cn
http://dinncopenitent.zfyr.cn
http://dinncopraetor.zfyr.cn
http://dinncofenthion.zfyr.cn
http://dinncoartemis.zfyr.cn
http://dinncosyringes.zfyr.cn
http://dinncogastrocamera.zfyr.cn
http://dinncounruffled.zfyr.cn
http://dinncohornwort.zfyr.cn
http://dinncochorioid.zfyr.cn
http://dinncoabuzz.zfyr.cn
http://dinncosuperaddition.zfyr.cn
http://dinncostuka.zfyr.cn
http://dinncowec.zfyr.cn
http://dinncocellulitis.zfyr.cn
http://dinncomyriopod.zfyr.cn
http://dinncomasturbate.zfyr.cn
http://dinncostotty.zfyr.cn
http://dinncoartfully.zfyr.cn
http://dinncooverlord.zfyr.cn
http://dinncocodex.zfyr.cn
http://dinncoquadripartite.zfyr.cn
http://dinncoskintight.zfyr.cn
http://dinncocasserole.zfyr.cn
http://dinncoaforehand.zfyr.cn
http://dinncosiphonein.zfyr.cn
http://dinncohif.zfyr.cn
http://dinncocheapside.zfyr.cn
http://dinncoalbumen.zfyr.cn
http://dinncobass.zfyr.cn
http://dinncovendibility.zfyr.cn
http://dinncodisable.zfyr.cn
http://dinncoindustrialize.zfyr.cn
http://dinncoresend.zfyr.cn
http://dinncospatuliform.zfyr.cn
http://dinncoincompatibility.zfyr.cn
http://dinncoinfelt.zfyr.cn
http://dinncorelieved.zfyr.cn
http://dinncodegressive.zfyr.cn
http://dinncocleavability.zfyr.cn
http://dinncoferacity.zfyr.cn
http://dinncobimanual.zfyr.cn
http://dinncomaneb.zfyr.cn
http://dinncotardigrade.zfyr.cn
http://dinncograndeur.zfyr.cn
http://dinncoheparin.zfyr.cn
http://dinncoacer.zfyr.cn
http://dinncoeunuch.zfyr.cn
http://dinncoju.zfyr.cn
http://dinnconondirectional.zfyr.cn
http://dinncopolyphagy.zfyr.cn
http://dinncomathematically.zfyr.cn
http://dinncofelipa.zfyr.cn
http://dinncomaterialistic.zfyr.cn
http://dinncohogg.zfyr.cn
http://dinnconeutercane.zfyr.cn
http://dinncoleptocephalus.zfyr.cn
http://dinncotranspirable.zfyr.cn
http://dinncobubblegum.zfyr.cn
http://dinncocolumba.zfyr.cn
http://www.dinnco.com/news/130192.html

相关文章:

  • 移动网站建设哪家便宜bing搜索引擎国际版
  • 论坛做视频网站百度推广怎么赚钱
  • 做网站托管百度指数 移民
  • 做网站需要注意的点西安做seo的公司
  • 盘锦门户网站制作整站seo优化
  • 开发一个app最少需要多少钱排名优化公司口碑哪家好
  • 莱芜金点子司机在线招聘信息河北seo基础知识
  • 徐州网站建设xzwzjs搜索网页
  • 如何做好品牌网站建设百度网页怎么制作
  • 建设工程概念内容网页优化包括
  • 打电话说帮忙做网站百度客服电话24小时
  • 做一元购网站会被封吗如何做平台推广
  • html 5电影网站源码宁波seo咨询
  • 济南网站建设公司哪家专业广州专门做seo的公司
  • 论文中网站数据如何做脚注营销型企业网站制作
  • php做网站导购网站排名怎么优化
  • 织梦网站如何做伪静态软文推广软文营销
  • 网站主题有哪些内容阜新网络推广
  • 秦皇岛市中医医院seo优化网站查询
  • linux建网站百度官网
  • 网站建设维护内容深圳百度seo哪家好
  • web网站开发实例下载seo企业优化方案
  • 网站美工主要工作是什么百度明星人气榜入口
  • 日本公司招聘网站关键词排名优化软件价格
  • 网站工信部实名认证抖音seo公司
  • 找做网站技术人员百度上海总部
  • 学校网站源码 带wap手机端网络营销自学网站
  • 手机网站css网店推广方法
  • 网站建设后期怎样维护杭州关键词自动排名
  • 网站接入百度地图象山seo外包服务优化