Explorar o código

fix example threejs-prerequisites.md

SeemsPyo %!s(int64=5) %!d(string=hai) anos
pai
achega
cdb5482850
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      threejs/lessons/threejs-prerequisites.md

+ 3 - 3
threejs/lessons/threejs-prerequisites.md

@@ -165,14 +165,14 @@ Destructuring works with arrays too. Assume an array `const position = [1, 2, 3,
 old code
 
 ```js
-const x = position[2];
-const y = position[1];
+const x = position[2]; // 3
+const y = position[1]; // 2
 ```
 
 new code
 
 ```js
-const [x, y] = position;
+const [, y, x] = position; // x = 3, y = 2
 ```
 
 Destructuring also works in function arguments