Summing intertwined terms of an array
I'm not sure exactly what you're looking for, but perhaps something like this?

[x1,y1,dx,dy]=prompt("Please enter the positions separated by commas").split`,`
dx-=x1
dy-=y1
console.log(dx,dy)


Reusing x2 and y2 as dx and dy, respectively, lets you use the -= operator to shorten it a bit.