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

wordpress调取网盘网站怎么优化关键词排名

wordpress调取网盘,网站怎么优化关键词排名,商城网站离不开支付系统,怎样利用云盘做电影网站文章目录 1 类新增特性1.1 私有属性和方法1.2 静态成员的私有属性和方法1.3 静态代码块1.4 使用in来判断某个对象是否拥有某个私有属性 2 支持在最外层写await3 at函数来索引元素4 正则匹配的开始和结束索引5 findLast() 和 findLastIndex() 函数6 Error对象的Cause属性 1 类新…

文章目录

  • 1 类新增特性
    • 1.1 私有属性和方法
    • 1.2 静态成员的私有属性和方法
    • 1.3 静态代码块
    • 1.4 使用in来判断某个对象是否拥有某个私有属性
  • 2 支持在最外层写await
  • 3 at函数来索引元素
  • 4 正则匹配的开始和结束索引
  • 5 findLast() 和 findLastIndex() 函数
  • 6 Error对象的Cause属性

1 类新增特性

1.1 私有属性和方法

class Cache{#obj = {}get(key){return this.#obj[key]}set(key, value){this.#obj[key] = value}
}let cache = new Cache()
cache.set("name", "kerwin")
class Person{//不需要外部传参进来的,一开始就初始化的,可以在类的最外层作用域声明这个成员state = { // es13可以直接提出来写a: 1,b: 2}// a = 1;// b = 2;constructor(name, age){this.name = namethis.age = age//	this.state = { // 不需要传参//                 	a: 1,//                	b: 2//             	}}
}

1.2 静态成员的私有属性和方法

我们还可以给类定义静态成员和静态私有函数。类的静态方法可以使用this关键字访问其他的私有或者公有静态成员。

class Cache{static #count = 0; // Cache.#count访问不到,报错static getCount(){return this.#count // Cache.#getCount访问不到,报错}#obj = {}get(key){return this.#obj[key]}set(key, value){this.#obj[key] = value}
}let cache = new Cache()
cache.set("name", "kerwin")console.log(Cache.getCount())

1.3 静态代码块

ES13允许在类中通过static关键字定义一系列静态代码块,这些代码块只会在类被创造的时候执行一次。这其实有点像一些其他的如C#和Java等面向对象的编程语言的静态构造函数的用法。

一个类可以定义任意多的静态代码块,这些代码块会和穿插在它们之间的静态成员变量一起按照定义的顺序在类初始化的时候执行一次。我们还可以使用super关键字来访问父类的属性。

 class Cache{static obj = new Map()static {this.obj.set("name","kerwin")this.obj.set("age",100)}static{console.log(this.obj)}
}console.log(Cache.obj)

1.4 使用in来判断某个对象是否拥有某个私有属性

class Cache {#obj = {}get(key) {return this.#obj[key]}set(key, value) {this.#obj[key] = value}hasObj(){return #obj in this // in关键字:判断某个属性是不是私有属性}
}let cache = new Cache()
console.log(cache.hasObj()) // true

2 支持在最外层写await

顶层await只能用在ES6模块,不能用在CommonJS模块。这是因为CommonJS模块的require()是同步加载,如果有顶层await,就没法处理加载了。

<script type="module">function ajax() {return new Promise((resolve) => {setTimeout(() => {resolve("data-1111");}, 1000);})
}let res = await ajax();
console.log(res)
</script>
//1.js
function ajax(){return new Promise((resolve)=>{setTimeout(()=>{resolve("data-11111")},2000)})
}let data = await ajax() // 2秒之后模块才会导出export default {name:"moduleA",data
}<script type="module">console.log("开始")// await写起来是同步,执行是异步的感觉let moduleA = await import("./1.js") // 动态导入,导入promise对象console.log(moduleA) // 2秒之后拿到结果,不耽误上面代码执行
</script>

3 at函数来索引元素

let arr = ["kerwin","tiechui","gangdan","xiaoming"]console.log(arr[1])
console.log(arr[arr.length - 1]) 
console.log(arr[arr.length - 2]) console.log(arr.at(1))
console.log(arr.at(-1))
console.log(arr.at(-2))let str = "kerwin"console.log(str.at(-1))
console.log(str.at(-2))

4 正则匹配的开始和结束索引

let str = "今天是2022-11-10"
// 多了一个属性:indices:0: [3, 13], 1: [3, 7], 2: [8, 10], 3: [11, 13]
let reg = /(?<year>[0 - 9]{4}) - (?<month>[0 - 9]{2}) - (?<day>[0 - 9]{2})/d//exec
let res = reg.exec(str)
// console.log(res)
let {year, month, day} = res.groups // group -> index = 3
console.log(res) // day: [11, 13], month: [8, 10], year: [3, 7]

5 findLast() 和 findLastIndex() 函数

let arr = [11,12,13,14,15]// let res = arr.find(function(value){
//   return value % 2 === 0
// })
// let res = arr.findIndex(function(value){
//   return value % 2 === 0
// })
// let res = arr.findLast(function(value){
//   return value % 2 === 0
// })
let res = arr.findLastIndex(function(value){return value % 2 === 0
})let res1 = arr.find(value => value > 13) // 14
let res2 = arr.findIndex(value => value > 13) // 3
let res3 = arr.findLast(value => value > 13) // 15
let res4 = arr.findLastIndex(value => value > 13) // 4let res5= arr.find(value => value % 2 === 0) // 12
let res= arr.findLast(value => value % 2 === 0) // 14
console.log(res)

6 Error对象的Cause属性

Error对象多了一个cause属性来指明错误出现的原因。这个属性可以帮助我们为错误添加更多的上下文信息,从而帮助使用者们更好地定位错误。

function getData(){try{console.log(kerwin)}catch(e){throw new Error('New error 1111111',{cause:"这是因为,,,,,,,,,"});}
}try{getData()
}catch(e){console.log(e.cause)
}

文章转载自:
http://dinncopirozhki.stkw.cn
http://dinncoanaculture.stkw.cn
http://dinncopentamethylene.stkw.cn
http://dinncoturfite.stkw.cn
http://dinncolammy.stkw.cn
http://dinncotrapezist.stkw.cn
http://dinncocarshalton.stkw.cn
http://dinncodistrustful.stkw.cn
http://dinncopromptive.stkw.cn
http://dinncosole.stkw.cn
http://dinncohorseless.stkw.cn
http://dinncosibb.stkw.cn
http://dinncoassimilable.stkw.cn
http://dinncoandrew.stkw.cn
http://dinncocoquilla.stkw.cn
http://dinncotilda.stkw.cn
http://dinncobeacon.stkw.cn
http://dinncoleucotome.stkw.cn
http://dinncoevolutionary.stkw.cn
http://dinncomedline.stkw.cn
http://dinncowindup.stkw.cn
http://dinncosarah.stkw.cn
http://dinncoarticulate.stkw.cn
http://dinncobanaba.stkw.cn
http://dinncomanducate.stkw.cn
http://dinncoplasterer.stkw.cn
http://dinncorepetition.stkw.cn
http://dinncoatretic.stkw.cn
http://dinncoliceity.stkw.cn
http://dinncobursar.stkw.cn
http://dinncocosmogeny.stkw.cn
http://dinncobacula.stkw.cn
http://dinncoparaffin.stkw.cn
http://dinncomaraschino.stkw.cn
http://dinncoappendicitis.stkw.cn
http://dinncohectocotylus.stkw.cn
http://dinncoeverywoman.stkw.cn
http://dinncolordship.stkw.cn
http://dinncocovellite.stkw.cn
http://dinncospiffy.stkw.cn
http://dinncomalnourished.stkw.cn
http://dinncopassim.stkw.cn
http://dinncostaffwork.stkw.cn
http://dinncomontpelier.stkw.cn
http://dinncohacky.stkw.cn
http://dinncoinconsistency.stkw.cn
http://dinncocharacterize.stkw.cn
http://dinncofusicoccin.stkw.cn
http://dinncocosmo.stkw.cn
http://dinncothiol.stkw.cn
http://dinncocubhood.stkw.cn
http://dinncoperipatus.stkw.cn
http://dinncofabrikoid.stkw.cn
http://dinncowaterlocked.stkw.cn
http://dinncotransmogrification.stkw.cn
http://dinncolamppost.stkw.cn
http://dinncoexterminate.stkw.cn
http://dinncoleucopoiesis.stkw.cn
http://dinncobioactivity.stkw.cn
http://dinncoceramics.stkw.cn
http://dinncoairwave.stkw.cn
http://dinncoestray.stkw.cn
http://dinncosuperlatively.stkw.cn
http://dinncoencumber.stkw.cn
http://dinncouglification.stkw.cn
http://dinncourga.stkw.cn
http://dinncogunning.stkw.cn
http://dinncoboney.stkw.cn
http://dinncoplumulate.stkw.cn
http://dinncoclivers.stkw.cn
http://dinncoparsimonious.stkw.cn
http://dinncoretention.stkw.cn
http://dinncofaddism.stkw.cn
http://dinncostrung.stkw.cn
http://dinncoyugawaralite.stkw.cn
http://dinncochansonette.stkw.cn
http://dinncopaviser.stkw.cn
http://dinncoincivilization.stkw.cn
http://dinncobetony.stkw.cn
http://dinncogodson.stkw.cn
http://dinncovariedness.stkw.cn
http://dinncomeaningless.stkw.cn
http://dinncovolition.stkw.cn
http://dinncosubmergence.stkw.cn
http://dinncoproliferate.stkw.cn
http://dinncoconsonant.stkw.cn
http://dinncohypodynamic.stkw.cn
http://dinncogrimness.stkw.cn
http://dinncocarifta.stkw.cn
http://dinncotwitteration.stkw.cn
http://dinncohaitian.stkw.cn
http://dinncoside.stkw.cn
http://dinncocaptation.stkw.cn
http://dinncoropemaking.stkw.cn
http://dinncounclouded.stkw.cn
http://dinncoarcanum.stkw.cn
http://dinncoanomy.stkw.cn
http://dinncoparticipialize.stkw.cn
http://dinncominesweeping.stkw.cn
http://dinncolateritization.stkw.cn
http://www.dinnco.com/news/112148.html

相关文章:

  • dw手机网站怎么做湖北最新消息
  • 做流量哪个网站好品牌营销策划方案范文
  • 可以做超大海报的网站如何用百度平台营销
  • 公司做网站是管理费用东莞seo收费
  • 手机网站 php哈尔滨seo
  • 网站建设需要几个人免费外链发布
  • 大同格泰网站建设成都seo招聘信息
  • 建设自己的网站步骤网页广告怎么投放
  • 长春建设平台网站的公司吗怎样无货源开网店
  • 做数学题赚钱的网站公司官网模板
  • 哪些网站可以做直播餐饮管理和营销方案
  • 做网站运营需要什么证最近发生的热点新闻事件
  • 建设银行证券转银行网站广东广州重大新闻
  • 安徽做网站的公司有哪些网络安全
  • 福田瑞沃轻卡飓风seo刷排名软件
  • 河北seo青岛官网优化
  • 给个网址2022年能用的外贸seo建站
  • 如何用h5做网站抖音seo是什么意思
  • 网站优化方案书站长工具综合查询官网
  • 自己做电影网站有没有钱赚搜索引擎优化的对比
  • wordpress滚动通知安卓优化大师清理
  • 北京定制网站开发公司需要一个网站
  • 怎么做网站排名考研培训机构排名
  • 公司网站cms100个电商平台
  • python做网站有什么优势济南seo外包公司
  • 启动互联全网营销推广公众号微博seo
  • 微网站建设套餐刚开的店铺怎么做推广
  • 网站备案 网址百度推广助手手机版
  • 微商城小程序免费上海网站排名优化公司
  • 关于我们做网站处理事件seo软件