TGViewer
Web Development Web Development @webdevcoursefree ยท 79.6K subscribers
Post #3402 4.41K
โœ… Advanced JavaScript: ES6+ Concepts ๐Ÿ’ก๐Ÿง 

Mastering modern JavaScript is key to writing cleaner, faster, and more efficient code. Here's a breakdown of essential ES6+ features with examples.

1๏ธโƒฃ let const (Block Scope)
let and const replace var.
โ€ข let = reassignable
โ€ข const = constant (can't reassign)
let score = 90;
const name = "Alice";

โ–ถ๏ธ Use const by default. Switch to let if the value changes.

2๏ธโƒฃ Arrow Functions (=>)
Shorter syntax for functions.
const add = (a, b) => a + b;

โ–ถ๏ธ No this binding โ€“ useful in callbacks.

3๏ธโƒฃ Template Literals
Use backticks ( `) for multiline strings and variable interpolation.
const user = "John";
console.log(Hello, ${user}!);


4๏ธโƒฃ Destructuring
Extract values from objects or arrays.
const person = { name: "Sam", age: 30 };
const { name, age } = person;


5๏ธโƒฃ Spread and Rest Operators (...)
โ€ข Spread โ€“ expand arrays/objects
โ€ข Rest โ€“ collect arguments
const nums = [1, 2, 3];
const newNums = [...nums, 4];

function sum(...args) {
return args.reduce((a, b) => a + b);
}


6๏ธโƒฃ Default Parameters
function greet(name = "Guest") {
return Hello, ${name}!;
}


7๏ธโƒฃ for...of Loop
Loop over iterable items like arrays.
for (let fruit of ["apple", "banana"]) {
console.log(fruit);
}


8๏ธโƒฃ Promises (Basics)
const fetchData = () => {
return new Promise((resolve, reject) => {
setTimeout(() => resolve("Done"), 1000);
});
};


Mini Practice Task:
โœ… Convert a regular function to arrow syntax
โœ… Use destructuring to get properties from an object
โœ… Create a promise that resolves after 2 seconds

๐Ÿ’ฌ Tap โค๏ธ for more!
  • โค 11
  • ๐Ÿ”ฅ 1
More from @webdevcoursefree
  1. Oct 17, 2026The Finance cell spans two rows. 10. Tables vs Layout Tables should be used for tabular daโ€ฆ
  2. Oct 17, 2026๐ŸŒ Web Development Roadmap โ€” Part 19 HTML Tables Tables are used to display information inโ€ฆ
  3. Oct 17, 2026๐—œ๐—•๐—  ๐—™๐—ฅ๐—˜๐—˜ ๐—ง๐—˜๐—–๐—› ๐—–๐—ข๐—จ๐—ฅ๐—ฆ๐—˜๐—ฆ ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ! ๐ŸŽ“ Explore IBM Cognitive Class and buildโ€ฆ
  4. Oct 16, 2026๐——๐—ฎ๐˜๐—ฎ ๐˜€๐—ฐ๐—ถ๐—ฒ๐—ป๐—ฐ๐—ฒ ๐—–๐—ฒ๐—ฟ๐˜๐—ถ๐—ณ๐—ถ๐—ฐ๐—ฎ๐˜๐—ถ๐—ผ๐—ป ๐—ช๐—ถ๐˜๐—ต ๐—”๐—œ๐Ÿ˜ Future Ready Data Scienโ€ฆ
  5. Oct 16, 2026๐ŸŒ Web Development Roadmap โ€” Part 18 HTML Lists Lists are used whenever information needsโ€ฆ
  6. Oct 14, 2026๐ŸŒ Web Development Roadmap โ€” Part 17 HTML Images โ€” <img> Tag Images make webpages more visโ€ฆ
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook โ†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 โ†’