const createText = (text) => {
const e = document.createElement('p')
e.innerHTML = text
return e
}class CreateText {
...??
}請(qǐng)問(wèn)第一段創(chuàng)建元素的代碼怎么用 ES6 的 Clsss 改寫,使得下面的代碼成立:const foo = creatText('hello')const bar = new CreateText('hello')console.log(foo == bar) // print `true`
請(qǐng)問(wèn)這一段創(chuàng)建元素的代碼怎么用 ES6 的 Clsss 改寫?
拉丁的傳說(shuō)
2018-10-11 18:23:00