JS6 Ecma
JS6 Ecma
JS6 Ecma
ES6 Features
Naflan Mohamed
@naflan-mohamed
let keyword
The let keyword allows you to declare a variable with block scope.
const keyword
The const keyword allows you to declare a constant. Constants are similar to
let variables, except that the value cannot be changed.
Naflan Mohamed
@naflan-mohamed
Default Parameter
default function parameters allow you to initialize named parameters with
default values if no values or undefined are passed into the function.
Rest Parameter
rest parameter (...) allows a function to treat an indefinite number of
arguments as an array
Naflan Mohamed
@naflan-mohamed
Spread Operator
spread operator that consists of three dots (...). The spread operator allows you
to spread out elements of an iterable object such as an array, map, or set.
for.. of Loop
for/of lets you loop over data structures that are iterable such as Arrays,
Strings, Maps, Node Lists, and more.
Naflan Mohamed
@naflan-mohamed
Template Literals
Template literals allow embedding expressions in strings using backticks (`).
With template literals, you can easily create multiline strings without using
concatenation or escape characters.
Object Literal
object literal is a syntactic construct for creating objects directly in code. It's
a convenient way to define and initialize objects without needing to use the
new keyword or a constructor function.
Naflan Mohamed
@naflan-mohamed
Arrow Function
Arrow functions allows a short syntax for writing function expressions.
Symbol
It represents a unique "hidden" identifier that no other code can accidentally
access. Symbols are often used as keys in object properties when you want to
avoid potential name clashes with other properties.
Naflan Mohamed
@naflan-mohamed
Promises
A Promise is a JavaScript object that links "Producing Code" and "Consuming
Code". "Producing Code" can take some time and "Consuming Code" must wait
for the result.
Set
A Set in JavaScript is a collection of unique values, where each value occurs
only once within the Set. It can contain values of any data type, including
primitive values like numbers and strings, as well as object references.
Naflan Mohamed
@naflan-mohamed
Map
The map() method in JavaScript is used to iterate over an array and transform
each element using a provided function, returning a new array containing the
transformed elements. It allows for concise and expressive code by applying
the same operation to each element of an array without mutating the original
array.
Naflan Mohamed
@naflan-mohamed
THANKS FOR YOU
ATTENTION
Naflan Mohamed
@naflan-mohamed
Naflan Mohamed
@naflan-mohamed