Contact: aviboots(AT)netvision.net.il
41,692 questions
54,362 answers
573 users
const str = 'node.js'; for (let i = 0; i < str.length; i++) { console.log(str[i], i); } /* run: n 0 o 1 d 2 e 3 . 4 j 5 s 6 */
const str = 'node.js'; const arr = [...str]; arr.forEach((ch, index) => { console.log(ch, index); }); /* run: n 0 o 1 d 2 e 3 . 4 j 5 s 6 */