trim()

function trim(str) {
return str.replace(/^\s*/, '').replace(/\s*$/, '');
}

 

 

getPrototypeOf 要返回其原型的对象

 

const prototype1 = {};
const object1 = Object.create(prototype1);

console.log(Object.getPrototypeOf(object1) === prototype1);
// expected output: true

posted @ 2020-01-08 10:40  沐少白  阅读(87)  评论(0)    收藏  举报