Parses a point as a string, in the form 'x,y' or 'x,y,z'. eg '10,15' will be returned as { x: 10, y: 15 }.
{ x: 10, y: 15 }
Throws an error if str is not a string.
str
Points.fromString(`10,15`); // { x:10, y:15 }Points.fromString(`a,10`); // { x:NaN, y:10 } Copy
Points.fromString(`10,15`); // { x:10, y:15 }Points.fromString(`a,10`); // { x:NaN, y:10 }
Use Points.isNaN to check if returned point has NaN for either coordinate.
Parses a point as a string, in the form 'x,y' or 'x,y,z'. eg '10,15' will be returned as
{ x: 10, y: 15 }
.Throws an error if
str
is not a string.Use Points.isNaN to check if returned point has NaN for either coordinate.