集合set.entries()的方法
对存入集合set内的value,使用set.entries()会形成【value,value】的形式
const setIter=new Set();
const entries = setIter.entries();
console.log(entries.next().value);
// 输出[value,value]的形式
会输出【value,value】形式的内容。但是打印console.log(setIter)仍然会输出添加的单value形式,如{value1,value2,value3}等等。
string.substring(from,to)方法
用于提取字符串中介于两个指定下标之间的字符。from是必需参数。一个非负的整数,规定要提取的子串的第一个字符在 string Object 中的位置。to可选。如果不填,则返回子串直到末尾,返回的子串包括开始处的字符,但不包括结束处的字符。
Array.concat方法
concat()方法连接两个或者多个数组,不会改变现有的数组,是返回一个新的数组,用法如下:
array1.concat(array2,array3,...,arrayX)
slice()方法,数组和字符串的使用区别
两者均不会改变原始数组。
array.slice()
string.slice(from,to)
|