1
0
mirror of https://github.com/apachecn/eloquent-js-3e-zh.git synced 2025-05-29 08:12:22 +00:00

Merge pull request #12 from Angus-Liu/master

Update 6.md
This commit is contained in:
飞龙 2019-03-11 23:21:33 +08:00 committed by GitHub
commit 20cd7d7d9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2
6.md
View File

@ -612,7 +612,7 @@ console.log([1] instanceof Array);
### 向量类型
编写一个构造器`Vec`,在二维空间中表示数组。该函数接受两个数字参数`x``y`,并将其保存到对象的同名属性中。
编写一个`Vec` 类,它表示二维空间中的一个向量。它接受`x``y`参数(数字),并将其保存到对象的同名属性中。
`Vec`原型添加两个方法:`plus``minus`,它们接受另一个向量作为参数,分别返回两个向量(一个是`this`,另一个是参数)的和向量与差向量。