In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article is about how to use let in ES6. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
What is ECMAScript?
A lot of people are confused, even the former engineers who worked for 3 to 5 years are confused. What is ECMAScript? What does it have to do with JavaScript?
Topic: JavaScript consists of three parts, namely: ECMAScript,BOM and (? ).
We can see from the title that ECMAScript is a part of JavaScript.
ECMAScript is the syntax specification in JavaScript! ECMAScript is an internationally standardized language, and all browser developers should develop browsers in accordance with its standards. Developers, too, program code in accordance with its rules.
The role of ECMAScript
Syntax-parsing rules, keywords, statements, declarations, actions, etc.
Type-Boolean, number, string, object, etc.
Prototype and inheritance
Standard library of built-in objects and functions-JSON, Math, array methods, object introspection methods, and so on.
After learning about ECMAScript, what is ES6?
ES6 is the abbreviation of ECMAScript 6, which is easy to understand. As the name implies, it is the sixth version of ECMAScript, which means there are earlier versions and there will be more versions in the future. History of ECMAScript
In November 1996, Netscape decided to submit JavaScript to ECMA, the International Organization for Standardization. The following year, ECMA released ECMAScript. This version is ECMAScript version 1. 0.
In June 1998, ECMAScript version 2.0 was released.
In December 1999, the ECMAScript3.0 version was released and became the general standard of JavaScript and was widely supported.
In October 2007, the draft version of ECMAScript4.0 was released and a substantial upgrade was made to version 3.0. however, the large companies led by Yahoo, Microsoft and Google opposed the substantial upgrade of JavaScript, advocated minor changes, the differences between the parties were too big, and the debate was too radical. The ECMA meeting decided to suspend the development of ECMAScript4.0.
In December 2009, the ECMAScript5.0 version was officially released.
In June 2015, ECMAScript 6 was formally adopted and became an international standard.
Why is ES6 popular?
Indeed, for many developers, ES6 brings a wide range of new features, as well as many convenient features (such as: arrow function and simple string interpolation, do not understand it, follow-up introduction), it is really exciting.
Summing up the above introduction of ECMAScritpt, we realize that in order to learn JavaScript well, we must first learn ECMAScritpt well, and it is the latest version of ECMAScritpt 6.
The purpose of let
ES6 brings many exciting features to developers, and the let keyword is one of them.
We usually use var to declare a variable when writing code, but we don't seem to use other keywords, whether we declare a string type, an array type, or a number type, etc., using a var (because JavaScript has dynamic types), which is very convenient. But now, ES6 tells you, in addition to var, you might as well try using let to declare variables.
Gee, so the let keyword is used to declare variables? Yes, the purpose of let is to declare variables.
Just declare it with var, why use the new let keyword to declare it? Is there any deficiency in using var? Yes, there is.
One of the shortcomings of var
The code is as follows
Var arr = []; for (var item0; I
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.