My first ReactJS app from scratch

ReactJS is a JavaScript library for developing user interfaces (UIs) which efficiently update when your data changes

ReactJS apps are very performant since ReactJS uses a virtual DOM which is a JavaScript object representing the regular DOM. The virtual DOM is much faster than the regular DOM

To install ReactJS on your computer open a command line and type:

$ npm install -g create-react-app

Proceed to create a new ReactJS project:

$ create-react-app myProject

Change to the directory where you just created your new ReactJS project and type:

$ cd myProject

$ npm start

to launch the developer server and open your localhost on port 3000 i.e. (http://localhost:3000)

Today we are going to write a small ReactJS app with a + and – button to add and to substract 1 to a counter:


What is ECMAScript 6 or ES6?

ECMAScript 6 (ES6) is the specification or standard followed by many programming languages like JavaScript, JScript, ActionScript, etc. The most popular programmimg language following this specification is JavaScript, That is why many people call ECMAScript 6 JavaScript 6

New features introduced in ECMAScript 6:

The let statement allows you to declare a variable with block scope

The const statement allows you to declare a constant

ES6 allows function parameters to have default values:

Introduces a row of new methods like:


Introduces a row of new properties like: