JSFiddle - React, Tailwind, and code Playground
by watsuyo_2
HTML
<script src="https://rawgit.com/tweeeety/logFiddle/master/execLogFiddle.js"></script>
JavaScript
const array = [1, 2, 3, 4, 5];
/* Aパターン */
for(const element of array) { // arrayの値を一つづつelmentに格納
console.log(element);
}
/* Bパターン */
/* const array = [1, 2, 3, 4, 5];
for(let i = 0; i < 5; i++) {
const element = array[i];
console.log(element);
} */
/*
1
2
3
4
5
*/