TS的内置对象

内置对象
let b: Boolean = new Boolean(1)

console.log(b)

let n: Number = new Number(true)

console.log(n)

let s: String = new String('cqs')

console.log(s)

let d: Date = new Date()

console.log(d)

let r: RegExp = /^1/

console.log(r)

let e: Error = new Error("error!")

console.log(e)

let xhr: XMLHttpRequest = new XMLHttpRequest();
。。。
dom对象
//dom Element HTML(元素名称,例如:Div)Element HTMLElement

let div = document.querySelector('div');

let divList: NodeList = document.querySelectorAll('div');

divList.forEach(item => {



})
多个dom类型
let divLists: NodeListOf = document.querySelectorAll('div input')

其他类型。。

let local: Storage = localStorage

let lo: Location = location

let promise: Promise = new Promise(r => r(''))

你可能感兴趣的:(TypeScript,前端,typescript)