Skip to content

Commit dbe0195

Browse files
authored
Fix: touch events example (#40539)
fix: update touch events example to use correct loop
1 parent 04abc9f commit dbe0195

File tree

1 file changed

+2
-1
lines changed
  • files/en-us/web/api/touch_events

1 file changed

+2
-1
lines changed

files/en-us/web/api/touch_events/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ function handleStart(evt) {
100100
const ctx = el.getContext("2d");
101101
const touches = evt.changedTouches;
102102

103-
for (const [i, touch] of touches.entries()) {
103+
for (let i = 0; i < touches.length; i++) {
104+
const touch = touches[i];
104105
log(`touchstart: ${i}.`);
105106
ongoingTouches.push(copyTouch(touch));
106107
const color = colorForTouch(touch);

0 commit comments

Comments
 (0)