Skip to content
Discussion options

You must be logged in to vote

Hi @RinkiyaKeDad , here are a few points already laid out by @meganindya in various PRs related to this,

In my opinion the optimal order would be:

  1. prototype function to class
  2. function style callbacks to arrow functions
  3. remove occurrences of that (CAREFUL!)
  4. Use const over let wherever feasible ... no vars pls

In short:

  1. Top-level variables go inside the constructor, e.g. const foo = 50; becomes this.foo = 50;.
  2. If the top-level prototype function is parameterized, the constructor now becomes parameterized. Note that those parameters will now only be visible inside the constructor, so create new instance variables with those values, and replace occurrences of the parameter variables any…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@meganindya
Comment options

Answer selected by meganindya
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants