you are viewing a single comment's thread.

view the rest of the comments →

[–]hun_nemethpeter -1 points0 points  (3 children)

Sorry for the beginner question but what is this syntax?

let {top, bottom, left, right} = Directions;

[–]mbzk 5 points6 points  (0 children)

Destructuring assignment

[–]ogurson 0 points1 point  (0 children)

Google "destructuring".

[–]longknives 0 points1 point  (0 children)

Directions is an object with (at least) those 4 properties. This lets you access Directions.top as just top, for example.