Contents
Introduction
हेलो दोस्तों आज हम इस post में ES6 (ECMAScript) के feature के बारे में जानेगे!.
What is ES6 in hindi ?
JavaScript ES6 javascript का एक नया version है, जिसे 2015 में introduced किया गया था!.
ES6 को ECMAScript 2015 या ECMAScript 6 से भी जाना जाता है!. ECMAScript एक standard है जिसका इस्तेमाल javascript programing language करती है!. ECMAScript javascript programing
language को कैसे काम करना चाहिए इसके बारे में specification provide करता है!.
ES6 के key features
ES6 features जैसे की…..
let and cons declarations
ES6 ने program में variable को declared करने के लिए दो नये तरीके introduced किये है let और const.
let का इस्तेमाल block-scoped variables के लिए किया जाता है!. जबकि const का इस्तेमाल उन variable के लिए किया जाता है जिन्हे फिर से re-assigned नहीं किया जा सकता है!.
Arrow functions
Arrow functions javascript में function को लिखने के लिए short syntax provide करता है!. वे ‘this’ keyword को easy तरीके से bind करता है!. जिससे की nested functions में correct “this” value को access करना आसान हो जाता है!.
Default parameters
ES6 Default parameter values को function के parametes में introduce करने की अनुमति देता है, जो उन functions को आसान बनता है जो option arguments को handle कर सकते है!.
Template literals
Template literals javascript में string को concatenate करने की एक आसान तरीका provide करता है, और वो भी multi-line string और string interpolation को support करे!.
Destructuring
Destructuring आपको arrays और objects से value को निकलने और उन्हें variable के लिए assign करने की अनुमति देता है!.
Spread operator
Spread operator का इस्तेमाल array और object को अलग-अलग elements में spread के लिए किया जा सकता है!. जो function arguments या array manipulation के लिए उपयोगी हो सकता है!.
Classes
ES6 ने javascript में classes बनाने के लिए एक new syntax introduced किया है जो दूसरी programing language से आने वाले devloper के लिये एक अधिक familiar syntax provide करता है!.
Modules
ES6 ने javascript के लिये एक नया module system introduce किया जो better code organization और projects के आसान code sharing करने की अनुमति देता है!.
Promises
Promises javascript में asynchronous operation को handle करने का एक तरीका provide करता है!.
Generators
Generators function को लिखने का एक तरीका provide करता है जिन्हे stop और फिर से शुरू किया जा सकता है, जो लंबे समय तक चलने वाले operations को handle करने के लिये उपयोगी हो सकता है!.
Enhanced object literals
ES6 ने object literals में enhancements introduce किया, जिसमे computed propery name का इस्तेमाल करने की ability शामिल है!.
Block-scoped functions
ES6 ने block-scoped function declarations को introduce किया जो perticular एक block के andar declare function ( जैसे की एक if statement) केवल उस block के अंदर ही access किये जा सकता है!.
Rest parameters
Rest parameters आपको argument की एक variable number को introduce करने की अनुमति देता है, जिसके अधिक flexible functions को लिखना आसान हो जाता है!.
ये ES6 के कुछ key feature है, और कई अन्य भी है कुल मिलकर, ES6 ने language में कई सुधर introduced किये जो ऐसे काम करने के लिये आसान और अधिक enjoyable बनाते है, और यह दुनिया भर में javascript developers न व्यापक रूप से अपनाया है!.