1const array = ["one", "two", "three"]
2array.forEach(function (item, index) {
3 console.log(item, index);
4});
1<!DOCTYPE html>
2<html>
3<body>
4
5<h2>JavaScript For Loop</h2>
6
7<p id="demo"></p>
8
9<script>
10const cars = ["BMW", "Volvo", "Saab", "Ford"];
11
12let i = 0;
13let len = cars.length;
14let text = "";
15
16for (; i < len; ) {
17 text += cars[i] + "<br>";
18 i++;
19}
20document.getElementById("demo").innerHTML = text;
21</script>
22
23</body>
24</html>
25
1const list = ['first', 'second', 'third'];
2element.classList.add(...list);
3
1let str = "12345.00";
2str = str.substring(0, str.length - 1);
3console.log(str);
1
2
3 var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
4
5 for( var i = 0; i < arr.length; i--){
6
7 if ( arr[i] === 5) {
8
9 arr.splice(i, 1);
10 }
11
12 }
13
14 //=> [1, 2, 3, 4, 6, 7, 8, 9, 0]
15
16
1+-------------------------------+----------------+---------------------+---------------------+---------------------+--------+-------------+
2| Action | Condition | AspectRatioDragging | Dragging | Shape | Simple | Selected |
3+-------------------------------+----------------+---------------------+---------------------+---------------------+--------+-------------+
4| Shift Released | | ? ? ? | | | | |
5| Shift Pressed | | | AspectRatioDragging | | | |
6| Primary Mouse Button Pressed | Shift Key Held | | | ? ? ? | | |
7| Primary Mouse Button Pressed | | | | DraggingState | | |
8| Primary Mouse Button Released | | SelectedState | SelectedState | | | |
9| Primary Mouse Button Released | | ShapeState | ? ? ? | | | |
10| Escape Key | | ? ? ? | SimpleState | SimpleState | | ? ? ? |
11| Ctrl + D & Clicking Outside | | | | | | ? ? ? |
12+-------------------------------+----------------+---------------------+---------------------+---------------------+--------+-------------+