Day 9 - First Day in learning React
Today I started my first React course from udemy. I was very excited for the learning React. In the starting the course gave me a JavaScript recap and it was a great start as I came to know more things about JavaScript and I also came to know that React is a very powerful JavaScript library that can be used for doing front-end development and there is another thing called React Native which is used to create android and IOS apps.
Starting
Course first gave a recap of JavaScript -
- Understanding let & const
Both let & const are types of var, the difference is that value of let is changed later in code but the value of const doesn't change if once declared.
- Arrow function
These are easy ways to write functions in JavaScript.
Example :
hello = () => {
return "Hello World!";
}
- Exports and Imports
These commands can be used in JavaScript to export and import different values form one file to another.
Classes, properties & methods
Classes can be used to create objects. The constructor method is called automatically when a new object is created.
Example :
class Car {
constructor(name, year) {
this.name = name;
this.year = year;
}
}
- Spread & Rest operator
The spread operator allows you to spread out elements of an iterable object such as an array.
The rest parameter syntax allows a function to accept an indefinite number of arguments as an array, providing a way to represent data.
- Destructuring
Destructuring is a JavaScript expression that allows to unpack values from arrays, or properties from objects, into distinct variables
Today I completed these topics and It was a great day learning new things about JavaScript.