Explore New Syntax in JavaScript ES6 | Modern JavaScript Development

preview_player
Показать описание
#salesforce
#trailhead
#salestraining

Modern JavaScript Development

Explore New Syntax in JavaScript ES6
Learning Objectives
After completing this unit, you'll be able to:

Describe the difference between function and block scoping.
State a reason why the const keyword should be used.
Recognize shorthand ES6+ syntax used to initialize variables.
Identify the new destructuring syntax used to separate data.
Identify the backtick character used to create template literals.
Function vs Block Scope
Before ES6, the only way you could declare a variable or a function in JavaScript was using the var keyword. You now have other options, and in this unit we go over why you want to use them.

To begin, let's look a little closer at how variables are defined. Variables declared with the var keyword are said to be in the function scope. This means that a variable would exist only within the scope of the function in which it was declared. Or the nearest parent function, if it's a nested function.
Рекомендации по теме