codemarch
codemarch

@codemarch

19 Tweets 7 reads Aug 26, 2022
Must Know JavaScript ES6 features Topics.
Thread 🧡
1. The let keyword
let is a keyword that is used to declare a block scoped variable.
let cannot be redeclared.
Variables declared inside a { } block cannot be accessed from outside the block:
2. The const Keyword
We can't change the value of a constant once it's been initialize.
you cannot declare a constant without initializing it.
(a) Constant Arrays
You can change the elements of a constant array:
(b) Constant object:
You can change the properties of a constant object:
3. arrow function
The arrow function is one of the new features of the ES6 version of JavaScript.
Arrow Function as an Expression
4. JavaScript Classes
JavaScript Classes are templates for JavaScript Objects.
Use the keyword class to create a class.
5. Default Parameter Values
A way to set default values for function parameters.
6. Function Rest Parameter
The rest parameter (...) allows a function to treat an indefinite number of arguments as an array:
7. New Math Methods
(a) Math.trunc()
Math.trunc(x) returns the integer part of x:
(b). The Math.sign()
Math.sign(x) returns if x is negative, null or positive:
(c). The Math.cbrt()
Math.cbrt(x) returns the cube root of x:
(d) The Math.log2()
Math.log2(x) returns the base 2 logarithm of x:
(e) Number.isInteger()
It returns true if a value is an integer of the datatype Number. Otherwise it returns false .
(f) Number.isSafeInteger()
The Number.isSafeInteger() method determines whether the provided value is a number that is a safe integer.
(g) isFinite()
determine whether a number is a finite number.
(h) isNaN()
This method returns true if a value is NaN.
If you enjoyed reading this thread, please do the following:
1. Like the thread❀️
2. Retweet the first tweet.πŸ”ƒ
3. Follow me and enable notifications: βœ…
@CodeMarch
Thank you for reading all the way through.
Download our free JavaScript Resources ebook Here:
codemarch.gumroad.com

Loading suggestions...