for (let [index, val] of array.entries()) {
// your code goes here
}
const targetText = ''
let reg = /e(.*?)e/g;
let result;
while((result = reg.exec(targetText)) !== null) {
// result: ['', '', '', index: 210, input: '[targetText]', groups: undefined]
doSomethingWith(result);
}
const beatles = ["paul", "john", "ringo", "george"];
beatles.forEach((beatle) => {
console.log(beatle.toUpperCase());
});
const beatles = [ "john", "paul", "ringo", "george"];
beatles.forEach((beatle) => {
console.log(beatle);
});