JS Recap
01
02
03
04
05
06
Introduction
JS Recap
Break!
JS Recap
JS Recap
Questions!
var / let / const
modules, imports & exports
Arrow functions
01 Introduction
Course Structure
01 - Welcome and JavaScript Recap
02 - JavaScript Recap “Destructing and Array Functions“
03 - JS to know for React
04 - Introduction to JSX
05 - React Components
06 - Conditional Rendering, Rendering Lists and Handling Events
07 - Thinking in React: reusability and hierarchy
08- Children and Styling
09 - useEffect & async await & fetch
10 - Routing
Practical Things
Communication
What is React?
React Alternatives
Questions?
JS Recap - var / let / const
Modern JavaScript / ES2015+
Javascript (or ECMAScript) Versions
Edition | Date published | Name |
1 | June 1997 | |
2 | June 1998 | |
3 | December 1999 | |
4 | -- Abandoned -- | |
5 | December 2009 | |
5.1 | June 2011 | |
6 | June 2015 | ECMAScript 2015 (ES2015) |
7 | June 2016 | ECMAScript 2016 (ES2016) |
8 | June 2017 | ECMAScript 2017 (ES2017) |
9 | June 2018 | ECMAScript 2018 (ES2018) |
10 | June 2019 | ECMAScript 2019 (ES2019) |
11 | June 2020 | ECMAScript 2020 (ES2020) |
Datatypes in JS
Datatypes in JS
Source: justjavascript.com
var / let / const
var / let / const
Variable Scope
var / let / const
Redeclaring
var / let / const
Reassignment
const - Primitive Values vs. Objects
const
with
Objects
var / let / const - Semantic Perspective
var / let / const - Summary
Questions?
Break!
JS Recap - Template Literals
Template Literals
Template literals are string literals allowing embedded expressions. You can use multi-line strings and string interpolation features with them.�They were called "template strings" in prior editions of the ES2015 specification.�
�
Syntax: �
The problem
Here’s a situation that comes up all the time: You need to build a URL. In this case, you’re building a link to an image on a cloud service. Your cloud service is pretty great, though. In addition to hosting the asset, you can pass query parameters that will convert the asset in a variety of ways (height, width, and so on).
😬 URLs get particularly ugly because you have to add slashes between the parts of a route along with the building blocks of queries such as ?, =, and &. Traditionally, you have to combine each piece with a + sign.
Alternatively with Template Literals
JS Recap - Arrow Functions
Your usual JS function
• The word function
• Name of the function�• Parentheses around arguments
• The word return
• Curly braces
Galaxy Brain Function Definition
JS Recap - Modules, import and export
Modules
In React projects (and actually in all modern JavaScript projects), you split your code across multiple JavaScript files - so-called modules. You do this, to keep each file / module focused and manageable.
To still access functionality in another file, you need export (to make it available) and import (to get access) statements.
[Very detailed yet simple explanation of imports and exports in JS] https://javascript.info/import-export