![]() ![]() In javascript, const is considered to be more powerful than var.Once used to store a variable it can’t be reassigned.In simple words, it is an immutable variable except when used with objects. They both have their own way of storing variables.Ĭonst: The const keyword is mainly used to store that variable who’s value is not going to be changed.Consider an example where you are creating a web application where you want to store a variable whose value is not going to change, then const is definitely the best choice to store that variable. But it had some serious issues, also it was not developers’ favorite so in the ES6 version, we were introduced to const and let keywords which allows us to store variables. Let’s take a look at them one by one.īefore ES6 we mainly made use of the var keyword whenever we wanted to declare a variable. It’s fair to say that with the use of ES6 features we write less and do more, hence the term ‘write less, do more’ definitely suits ES6.ĮS6 introduced several key features like const, let, arrow functions, template literals, default parameters, and a lot more. Javascript ES6 has been around for a few years now, and it allows us to write code in a clever way which basically makes the code more modern and more readable. Zakas provides a complete guide to the object types, syntax, and other exciting changes that ECMAScript 6 brings to JavaScript. ![]() ISRO CS Syllabus for Scientist/Engineer Exam.ISRO CS Original Papers and Official Keys.(ES6) code snippets extension adds snippets for ES6 (ECMAScript 6) syntax. ![]() GATE CS Original Papers and Official Keys Learn more about installing and integrating JavaScript and Node.js extensions.DevOps Engineering - Planning to Production.5 Babel 6 still has no official support decorators, but you can use this plugin. ![]()
0 Comments
Leave a Reply. |