javascript4 Learning ECMScript 6+ (ES6+) 2. Variables and Data Structures 1) let keyword - let is helping us enforce block scoping in JavaScript. // Example 1(1) - var var topic = "JavaScript"; if (topic) { var topic = "ECMAScript"; console.log("block", topic); } console.log("global", topic); // expected "global ECMAScript" // Example 1(2) - let var topic = "JavaScript"; if (topic) { let topic = "ECMAScript"; console.log("block", topic.. 2021. 2. 25. React JS - State & Lifecycle Why use class components instead of function components? - To use "state" class App extends React.Component{ state = { } render(){ return } } React automatically execute the render method inside of the class component. A state is an object. The data can be change (dynamic data). The number is: {this.state.count} Add Minus If you write "this.add()", the method will be executed immediately, not wh.. 2021. 2. 24. React JS - JSX & Props function Food({ favorite }) { return I like {favorite}; } function App() { return ( Hello ); } JSX is something like HTML + JavaScript. In the example above, I made a JSX with Prop named "favorite" and put a value named "kimchi" The first example shows how to send value from one component to another. In this case, it is using prop favorite and the Food component is receiving the value using the .. 2021. 2. 23. How to start React JS Project? For the starter, I needed to install 3 things. 1. Node JS - Downloaded from the official website. 2. NPM - Came witH Node JS 3. NPX - Ran command "npm install npx -g" There is an easy web to setup React Web app with one command. - npx create-react-app (name-of-the-app) github.com/facebook/create-react-app 2021. 2. 23. 이전 1 다음