JS Recap
React Week 01
Consent for Audio Recording
02
03
04
05
06
01
Break!
JS Recap
JS Recap
JS Recap
Questions?
JS Recap
var / let / const
10 min
10 min
modules, imports & exports
15 min
5 min
30 min
Arrow functions
40 min
var / let / const
Template Literals
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 -- | ActionScript 3 |
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) |
12 | March 2021 | ECMAScript 2021 (ES2021) |
13 | June 2022 | ECMAScript 2022 (ES2022) |
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 that allow 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 & 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.