Written by
java-style
on
on
[자바스크립트] 반복문
[자바스크립트] 반복문
728x90
let header = "Templates Literals"; let tags = ["template literals", "javascript", "es6"]; let html = `
${header}
- `; for (const x of tags) { html += `
- ${x} `; } html += `
출처 : https://www.w3schools.com/js/tryit.asp?filename=tryjs_templates_html
JavaScript Array.forEach() Calls a function once for each array element. const numbers = [45, 4, 9, 16, 25]; let txt = ""; numbers.forEach(myFunctions); document.getElementById("demo").innerHTML = txt; function myFunctions(value, index, array) { txt += value + "
"; }
출처 : https://www.w3schools.com/js/tryit.asp?filename=tryjs_array_foreach
from http://rearea.tistory.com/83 by ccl(S) rewrite - 2021-11-07 04:28:19