Created
January 15, 2019 09:17
-
-
Save apolopena/26ed8d62c82270ea26680ad8e0481fc0 to your computer and use it in GitHub Desktop.
JavaScript: es6 destructuring an array of point arrays to and array of x, y location objects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const points = [ | |
[1, 2], | |
[50, -10], | |
[110, 405] | |
]; | |
points.map(([x, y]) => { | |
return { x, y }; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment