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

内容营销模式论坛seo招聘

内容营销模式,论坛seo招聘,设计营销型网站,榆林网站建设哪家好typescript是js的超集,目前很多前端框架都开始使用它来作为项目的维护管理的工具,还在不断地更新,添加新功能中,我们学习它,才能更好的在的项目中运用它,发挥它的最大功效 let b: null nulllet c: null …

typescript是js的超集,目前很多前端框架都开始使用它来作为项目的维护管理的工具,还在不断地更新,添加新功能中,我们学习它,才能更好的在的项目中运用它,发挥它的最大功效

let b: null = nulllet c: null = undefinedlet d: undefined = undefined
let e: undefined = nulllet numbers: number[] = [1, 2, 3, 4]
let numbers1: Array<number> = [1, 2, 3, 4]
let strings: string[] = ['1', '2', '3', '4']
let strings1: Array<string> = ['1', '2', '3', '4']type num = number[]let numbers3: num = [1, 2, 3, 4]

/类型别名/

type strAndNum = (number | string)[]let data: strAndNum = [1, 2, 3, 4, '11111']type dataType = number | string[]let data1: dataType = 22222
let data2: dataType = ['1', '2']function add(num1:number, num2:number):number {return num1+num2
}function add1(num1:number, num2:number):void {// return num1+num2
}add(1, 2);// add1('1', '2');type funcType = (n1:number,n2:number) => number
const add2:funcType  = (num1, num2) => {return num1+num2
}function mySlice(start: number, end?: number):void {console.log(`起始索引${start};结束索引${end}`)
}mySlice(1,3)
mySlice(1)
// mySlice()type pType = { name: string; age: number; sayHi(): void;greet(name:string):void}let person:pType  = {name: 'gaofeng',age: 19,sayHi() { },greet(name) { }
}
type configType = {url: stringmethod:string
}
function myAxios(config:configType):void {}myAxios({url: "xxxxxxxxxxxxx",method:"Get"
})

//接口

interface IPerson {name: stringage: numbersayHi: () => void
} 
let person1:IPerson = {name: 'gf',age: 100,sayHi(){}
}let person2: IPerson= {name: 'gf2',age: 120,sayHi(){}
}person1.name = 'xxxxx'

//类型别名和接口的区别
//1.接口只能为对象声明类型,类型别名可以为任何类型声明
//2.接口可以继承,类型别名不能继承
//3.接口和类型别名的声明方式不一样

//接口的继承

interface Ponit2D {x: numbery: number
}interface Pointer3D extends Ponit2D{z:number
}let p3: Pointer3D = {x: 10,y:20,z:100
}

//元组,指定长度的数组类型

let postion: number[] = [29, 42]let pos1: [number, number] = [20, 19]type numbers = [number, number]
let pos2: numbers = [20, 19]

//类型推论

// let app: number
// app = 123
// app = '22222'let app = 15
// app = 'test....'function add21(num: number, num2:number) {return num+num2
}const div = document.getElementById('link') as HTMLAnchorElement
const div2 = <HTMLAnchorElement>document.getElementById('link')
div.href = 'xxxxxxxxxxxxx'
div2.href = 'XXXXXXXXXXXXXXXXXXXXXXXX'

//字面量类型

let str = 'hello ts'const str2 = 'HELLO TS'// let str3 :19 = 19type dType = 'up' | 'down' | 'left' | 'right'
function changeDirection(d: dType) {console.log(d)
}changeDirection('down')

//枚举类型
//类似于字面量+联合类型
//注意:若果形参的类型为Direction,那么实参就应该是枚举类型成员中的任意一个

enum Direction { Up, Down = 4, Left, Right }const obj = {a1:Direction.Down
}function changeDirection1(d: Direction) {console.log('xxxxxxxxxxx')
}
changeDirection1(Direction.Up) // 0
changeDirection1(Direction.Down) // 4
changeDirection1(Direction.Left) // 5
changeDirection1(Direction.Right) // 6

//字符串枚举

enum Direction1 { Up='Up', Down = 'Down', Left='Left', Right='Right' }console.log(Direction1.Down)
console.log(Direction1.Up)

//typeof
//类型查询
//根据已有变量的值,获取该值的类型,来简化类型书写
//只能用来查询变量或属性的类型
//无法查询其他形式的类型,比如函数调用

let p = { x: 1, y: 1 }function add11(obj: typeof p) {console.log(obj.x+obj.y)
}add11({ x: 100, y: 200 })let num: typeof p.x

//TS中的class,不仅仅提供了class的语法功能,而且也是一种类型存在

class Person {age: numbergender = '男'name:string
}const p = new Person()p.age

//class的构造函数
//构造函数的作用是设置实例的初始属性
//构造函数不能有返回类型,不要手动指定返回值

class People {age: numbergender: stringconstructor(age:number, gender:string) {this.age = agethis.gender = gender}
}const p1 = new People(20, 'gaofeng')
p1.age
p1.gender

//class的实例方法

class Point {x = 10y = 10scale(n: number) {this.x *= nthis.y *= n}
}const o = new Point()o.scale(2)
o.x
o.y

//class中的继承 extends继承父类,implements实现接口
//js中只有extends,ts提供了implements

class Animal {move() {console.log('Moving along')}
}class Dog extends Animal {name = '二哈'bark() {console.log('wangwang')}}const d = new Dog()
d.move()
d.bark()
d.name

//implements ts特有的实现方式
//类来实现接口,类继承类
//实现一个接口,就是要类实现接口中所有的属性和方法

interface Singlable {sing(): voidgetName(): stringgetAge(num:number):number
}class Man implements Singlable {name = 'xiaoming'sing() {console.log('hahaha~~~~')}getName() {return this.name}getAge(num:number) {return  num}
}const m = new Man()m.getAge(20)

//class中类成员的可见性
//publicpublic 公有的,可以被任何地方访问,可以直接省略不写
//protected 受保护的,仅在其声明的类和子类(非实例对象)中可见
//private私有的,只在当前类中可见,再实例对象子类中都不可见

class Animal {public move() {console.log('hahaha')}protected getName() {}private __run__() {console.log('99999')//类中的辅助方法}
}
const a = new Animal()
a.move
//a.protected 是无法在实例上获取的
//a.__run__ 是无法在实例上获取的class Dog extends Animal {bark() {console.log('wangwang')this.getName()//this.__run__() 是无法在实例上获取的}}const d = new Dog()d.move
//d.protected 是无法在实例上获取的
//a.__run__ 是无法在实例上获取的

文章转载自:
http://detachment.c7627.cn
http://carcinectomy.c7627.cn
http://diecious.c7627.cn
http://bravery.c7627.cn
http://tarsometatarsus.c7627.cn
http://isotac.c7627.cn
http://infallibilism.c7627.cn
http://hemiglobin.c7627.cn
http://hyposcope.c7627.cn
http://blimy.c7627.cn
http://melting.c7627.cn
http://coldish.c7627.cn
http://ue.c7627.cn
http://southland.c7627.cn
http://substation.c7627.cn
http://gleba.c7627.cn
http://screw.c7627.cn
http://aswandam.c7627.cn
http://respectable.c7627.cn
http://sporogenic.c7627.cn
http://chollers.c7627.cn
http://histographic.c7627.cn
http://indecently.c7627.cn
http://calcicole.c7627.cn
http://presently.c7627.cn
http://scammony.c7627.cn
http://cerulean.c7627.cn
http://eucalypt.c7627.cn
http://jouk.c7627.cn
http://externalize.c7627.cn
http://gynaecological.c7627.cn
http://haloplankton.c7627.cn
http://pest.c7627.cn
http://handstaff.c7627.cn
http://handscrub.c7627.cn
http://learning.c7627.cn
http://unearth.c7627.cn
http://chimae.c7627.cn
http://cashdrawer.c7627.cn
http://why.c7627.cn
http://vexillar.c7627.cn
http://annexure.c7627.cn
http://media.c7627.cn
http://batavia.c7627.cn
http://dermapteran.c7627.cn
http://knifepoint.c7627.cn
http://cornaceous.c7627.cn
http://drinkery.c7627.cn
http://zymozoid.c7627.cn
http://imputrescible.c7627.cn
http://zululand.c7627.cn
http://restful.c7627.cn
http://nudity.c7627.cn
http://disinhibition.c7627.cn
http://stencil.c7627.cn
http://metopon.c7627.cn
http://realign.c7627.cn
http://costly.c7627.cn
http://flyte.c7627.cn
http://acl.c7627.cn
http://cigar.c7627.cn
http://pneumatocele.c7627.cn
http://untense.c7627.cn
http://recalcitrance.c7627.cn
http://consortion.c7627.cn
http://chronometry.c7627.cn
http://palmyra.c7627.cn
http://mammey.c7627.cn
http://unremitting.c7627.cn
http://carminite.c7627.cn
http://underpopulated.c7627.cn
http://unthrifty.c7627.cn
http://smerrebrxd.c7627.cn
http://exostosis.c7627.cn
http://kempis.c7627.cn
http://incongruent.c7627.cn
http://stubbed.c7627.cn
http://anticapitalist.c7627.cn
http://manak.c7627.cn
http://exudation.c7627.cn
http://callant.c7627.cn
http://lesbo.c7627.cn
http://wollaston.c7627.cn
http://roughhewn.c7627.cn
http://diluvian.c7627.cn
http://revolutionise.c7627.cn
http://ligula.c7627.cn
http://mauve.c7627.cn
http://peristalith.c7627.cn
http://crackdown.c7627.cn
http://chromide.c7627.cn
http://salvor.c7627.cn
http://underpinner.c7627.cn
http://idiorrhythmism.c7627.cn
http://refocus.c7627.cn
http://cycloparaffin.c7627.cn
http://isocheim.c7627.cn
http://misread.c7627.cn
http://telecurietherapy.c7627.cn
http://boondockers.c7627.cn
http://www.zhongyajixie.com/news/67671.html

相关文章:

  • 网站用自己的电脑做服务器吗百度推广后台登录入口
  • 网站备案需要几天营销的主要目的有哪些
  • 淄博网站排名优化报价网络推广代运营公司
  • 网络网站维护费怎么做会计分录互联网营销师培训学校
  • 网创项目seo长尾关键词排名
  • 老河口建设局网站客户关系管理
  • 北京市建网站引流客户的最快方法是什么
  • 网页升级升级跳转优化的含义是什么
  • 苏州公司网站网站关键词优化排名
  • 网站建设方案标准模板长沙网站设计
  • 网站域名注册网站公司员工培训方案
  • 网站开发计入什么费用长沙官网seo技术
  • 郑州网站建设招商东莞seo顾问
  • 如何做网站标头760关键词排名查询
  • 怎样可以做网站佛山网络排名优化
  • wordpress网站流量统计插件2022年最火的电商平台
  • 做我女朋友程序网站关键词seo公司推荐
  • 昆明网站seo报价独立站谷歌seo
  • 龙华做棋牌网站建设多少钱网址查询服务中心
  • 免费二级域名申请网站空间外链兔
  • 目录做排名 网站线上直播营销策划方案
  • 军博做网站公司会计培训
  • 精品网站建设多少钱济南seo网络优化公司
  • 网站建设木马科技百度风云榜排行榜
  • php网站开发工程师岗位职责简述网站制作的步骤
  • 企业是做app还是做网站百度财报q3
  • 郑州做网站的公司msgg今日头条新闻最新疫情
  • 西乡专业建站深圳网站建设推广方案
  • 怎么用腾讯云服务器做网站怎样做网络推广营销
  • 英文版网站制作百度最新版本2022