@@ -996,15 +996,15 @@ existing class, _inheriting_ part of its behavior.
996996
997997### A vector type
998998
999- {{index dimensions, "Vector type ", coordinates, "vector (exercise)"}}
999+ {{index dimensions, "Vec class ", coordinates, "vector (exercise)"}}
10001000
1001- Write a ((class)) ` Vector ` that represents a vector in two-dimensional
1001+ Write a ((class)) ` Vec ` that represents a vector in two-dimensional
10021002space. It takes ` x ` and ` y ` parameters (numbers), which it should save
10031003to properties of the same name.
10041004
10051005{{index addition, subtraction}}
10061006
1007- Give the ` Vector ` prototype two methods, ` plus ` and ` minus ` , that take
1007+ Give the ` Vec ` prototype two methods, ` plus ` and ` minus ` , that take
10081008another vector as a parameter and return a new vector that has the sum
10091009or difference of the two vectors’ (the one in ` this ` and the
10101010parameter) _ x_ and _ y_ values.
@@ -1018,11 +1018,11 @@ the origin (0, 0).
10181018``` {test: no}
10191019// Your code here.
10201020
1021- console.log(new Vector (1, 2).plus(new Vector (2, 3)));
1022- // → Vector {x: 3, y: 5}
1023- console.log(new Vector (1, 2).minus(new Vector (2, 3)));
1024- // → Vector {x: -1, y: -1}
1025- console.log(new Vector (3, 4).length);
1021+ console.log(new Vec (1, 2).plus(new Vec (2, 3)));
1022+ // → Vec {x: 3, y: 5}
1023+ console.log(new Vec (1, 2).minus(new Vec (2, 3)));
1024+ // → Vec {x: -1, y: -1}
1025+ console.log(new Vec (3, 4).length);
10261026// → 5
10271027```
10281028if}}
0 commit comments