repeat()
includes()
var str = "abc" console.log(str.includes("a")) //true console.log(str.repeat(3)); //abcabc console.log(str.repeat())
startsWith() endsWith()
var str = "abc" console.log(str.startsWith("a")); console.log(str.endsWith("c"));
set去重
let list = [2, 2, 2, 2, 3, 3, 4, 5, 5, 6, 6, 7, 0] let newList = new Set(list) console.log(newList);