One performance test
Test the execution time of a program
console.time('A') // 可以测试一段程序执行的时间
function fn(){...}
console.timeEnd('A')
Invert the case of a string
let str = "renzhenxuexideLUqian要加油啊! HAHA"
str = str.replace(/[a-zA_Z]/g,content=>{
content.toUpperCase()===content ? content.toLowerCase() : content.toUpperCase()
})
Three object-oriented features
Inheritance encapsulation polymorphism (js does not support, js supports abstraction)
4. What is a closure
Closures are a function, a scope can access local variables inside a function of additional
feature / action - extended variable range of action
What is the DOCTYPE of HTML
It is the document type of html.
There are many different documents on the web. Only the browser that understands the type of the document can correctly display the document.
HTML also has multiple different versions. Is the use of <! DOCTYPE>