4IT580: Docs
4IT580 WebGitLab

2nd Theoretical Class: JavaScript Essentials for React

Variable declarations

Use only if necessary => Use .
Don't use !

Template literals

Strings delimited with (backticks) allowing for multi-line strings and string interpolation

Destructuring

Unpack properties from an object or items from an array into constants.

Object destructuring


Useful features of this syntax:

Array destructuring

Rest & Spread operator ()

The operator can collect or expand values.

Expanding (spread)

Collecting (rest)

Optional chaining

Access a property of an object which is or

Arrow function

An alternative way of declaring a function

Arrow functions are useful for passing anonymous callback functions - see below.

Array method

Transform each element in an array using a callback function

Module imports/exports

Ways to split your application into smaller modules

Default import

Named imports

Resources