Update index.js

throw an Error when x,y is not look like a Number.