js string traversal Interface

ES6 new traversal interface string, the string may be such that for of loop iterates.

for(let v of 'abcdefg'){
  console.log(v)
}
All numbers in the search character string:
let str = 'a,b,c,d,e,f,g,1,2,3'
console.log(str.match(/\d+/g))

Guess you like

Origin www.cnblogs.com/knuzy/p/11059138.html