JavaScript for React

Pushpak Sharma
Sep 2, 2018 · 1 min read

Short read before you began with react ; It will be helpful :)

“black laptop computer turned on” by Dean Pugh on Unsplash

Keyword

Understanding scope of keyword and what was ES’6 has to offer !

Objects

key : value pair

This

standalone object

see this code and run in your machine ; note reference() is standalone object and will refer window object.

In ‘Strict Mode’ it will be undefined.

bind()

Functions in javascript are Object.

Fat Arrow =>

Many Benefits ; one is make code cleaner.

Fat Arrow and this (Together in Consideration)

See the Snippet carefully and read the commented lines.

Map Function

Map function is very important function will render in react.

Object Destructing

Make big project readable :)

Spread

Use to clone object and array.

Class

this is similar to like any other programming language.

Note: Name of class should begin with Upper Case

Inheritance

Again same as other programming language.

Access Specifier

normally the class are private until you export them in React.

There are two types of export

  1. named example :- import {ClassName}from ‘./path’;
  2. default example :- import ClassName from ‘./path’;

because in default we do export default ClassName;

Conclusion

Hope this help,Code explains better than word.

Happy Learning and code for good !

Pushpak Sharma

Written by

Code for good. Love to solve the coding question. Believe in Ideology — Overriding difficulty brings a new author(New version).

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade