Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method depends on how it is called.
  • We sometimes use => to define "arrow functions". They're like regular functions, but shorter. For example, x => x * 2 is roughly equivalent to function(x) { return x * 2; }. Importantly, arrow functions don't have their own this value so they're handy when you want to preserve the this value from an outer method definition.

Don't worry if this is too much to take in at once. The MDN JavaScript Reference is a stellar resource, and you can consult it whenever you get confused by something.

Also, when you feel unsure about what some newer syntax means, you can use the Babel REPL with the ES2015 preset to check what equivalent older syntax it compiles to.

@barayiti
Copy link

barayiti commented Jun 6, 2022

Thank you

@KadirYurekturk
Copy link

KadirYurekturk commented Jun 8, 2022

Thank you for info. And for showing me that I'm not alone :)

@syaiful-scooter
Copy link

syaiful-scooter commented Jun 9, 2022

Thank you for info. And for showing me that I'm not alone :)

so do i :)

@Jacobkyalo
Copy link

Jacobkyalo commented Jun 11, 2022

This is cool!

@imPrajwalKadam
Copy link

imPrajwalKadam commented Jun 19, 2022

Thank You.

@bashirhanafi
Copy link

bashirhanafi commented Jul 5, 2022

Thank you

@ROHIT25082000
Copy link

ROHIT25082000 commented Jul 10, 2022

Thank you

@0531010
Copy link

0531010 commented Jul 12, 2022

thank you very much!!!

@Ashwis
Copy link

Ashwis commented Jul 18, 2022

Helpful.

@BiteFoo
Copy link

BiteFoo commented Jul 19, 2022

helpful,thx a lot!!!

@mobvnzla
Copy link

mobvnzla commented Jul 19, 2022

what a chad

@collins-okafor
Copy link

collins-okafor commented Jul 21, 2022

Helpful

@prasannarames
Copy link

prasannarames commented Jul 21, 2022

it helps, thank you

@rabusmccaleb
Copy link

rabusmccaleb commented Jul 24, 2022

Helpful thanks!

@Saya47
Copy link

Saya47 commented Aug 2, 2022

@gaearon hello the last link is broken: Babel REPL with the ES2015 preset
image

@callseven
Copy link

callseven commented Aug 3, 2022

Helpful thanks!

@sodexx7
Copy link

sodexx7 commented Aug 4, 2022

Thanks your shares.

@Murat88
Copy link

Murat88 commented Aug 8, 2022

thank you !

@chienhsiang-hung
Copy link

chienhsiang-hung commented Aug 15, 2022

thank you

@Derrick-Tai
Copy link

Derrick-Tai commented Aug 17, 2022

Thank you very much!

@felixtemikotan
Copy link

felixtemikotan commented Aug 17, 2022

Thank you. This proves to be very informative.

@TUCCHI1
Copy link

TUCCHI1 commented Aug 18, 2022

thanks

@moooza
Copy link

moooza commented Aug 28, 2022

thank you

@chlxdb
Copy link

chlxdb commented Aug 29, 2022

Thanks!!

@napalfacundo
Copy link

napalfacundo commented Aug 29, 2022

Thank you, helpful!

@ask-traceroute
Copy link

ask-traceroute commented Aug 30, 2022

ありがとう

@Gameonn
Copy link

Gameonn commented Sep 6, 2022

@gaearon hello the last link is broken: Babel REPL with the ES2015 preset image

Try out this link for Babel REPL with the ES2015 preset, it worked for me.

@Coderamrin
Copy link

Coderamrin commented Sep 9, 2022

a very brief intro to ES6. thanks fro this simplest tutorial.

@huynhit24
Copy link

huynhit24 commented Sep 25, 2022

Good!

@Basar1985
Copy link

Basar1985 commented Sep 25, 2022

Nice project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment