Write a constructor Vector that represents a vector in two-dimensional space. It takes x and y parameters (numbers), which it should save to properties of the same name.
Give the Vector prototype two methods, neg, plus and minus. The first returns the opposite of a vector (x,y), i.e., it returns (-x,-y). The other two take another vector as a parameter and return a new vector that has the sum or difference of the two vectors' (the one in this and the parameter) x and y values.
Add a getter property length to the prototype that computes the length of the vector -that is, the distance of the point (x, y) from the origin (0, 0)
Important remark:
FizzQuizz-ThuDec142017.pdf
Copy&Paste your code in the following text box. Drag the bottom-right corner to make sure all your lines are visible wihtout scrolling.
Copy&Paste your HTML code in the following text box. It must load your previous code and must contain the necessary test code. Drag the bottom-right corner to make sure all your lines are visible wihtout scrolling.