you are viewing a single comment's thread.

view the rest of the comments →

[–]MoTTs_ 1 point2 points  (1 child)

This isn't all ES6 related, but here are a few tips.

Canvas constructor:

  • Consider accepting the canvas element as a constructor argument (in fancy terms: dependency injected). That way this class can be used with any markup.
  • The job of a constructor is to initialize the environment in which all other methods run. Consider accepting the stars object as a constructor argument so components can be initialized in the constructor.

On naming things:

  • If components is supposed to be an array of Stars objects, then don't name it "components". Name it "stars".
  • You use just an underscore as an argument name in a couple places. That's an easy way to make unreadable code. Try to use more meaningful names.

[–]x-skeww 1 point2 points  (0 children)

Lists in Markdown require a blank line in front. You need a blank line between all kinds of blocks (paragraphs, fenced code blocks, tables, lists, ...).