Примери за използване на Arrow function на Английски и техните преводи на Български
{-}
-
Colloquial
-
Official
-
Medicine
-
Ecclesiastic
-
Ecclesiastic
-
Computer
Arrow functions do not have their own this.
The prototype property of an arrow function doesn't exist.
An arrow function does not have its own this;
The event handler in this example is an arrow function that calls this. doSomething().
Arrow functions throw an error when used with new.
By doing so,JavaScript engines are better able to optimize arrow function execution.
Arrow functions do not have their own arguments object.
No prototype- since you can't use new on an arrow function, there's no need for a prototype.
Creating an arrow function that is also a generator is not possible.
Note that the parentheses are only around the arrow function definition, and not around("Nicholas").
Arrow functions have a more concise syntax, lexical this binding, and no arguments object.
That arguments object is then available no matter where the arrow function is executed later on.
We used an arrow function above, but it also works with regular functions: .
In this code, the call to new MyType()fails because MyType is an arrow function and therefore has no[[Construct]] behavior.
An arrow function cannot contain a line break between its parameters and its arrow. .
If you try to use the new operator with an arrow function, you will get an error, as in this example.
Arrow functions also have a name property that follows the same rule as other functions. .
Despite the different syntax, arrow functions are still functions, and are identified as such.
Arrow functions cannot be used as constructors and will throw an error when used with new.
You can accomplish the same thing using arrow functions, so long as you wrap the arrow function in parentheses.
Since arrow functions do not have their own this, the methods call() or apply() can only pass in parameters.
To avoid creating an extra function, a better way to fix this code is to use an arrow function.
Additionally, arrow functions can't change their this binding, and so can't be used as constructors.
The array methods that accept callback functions such as sort(), map(), and reduce()can all benefit from simpler arrow function syntax, which changes seemingly complex processes into simpler code.
With an arrow function, we have to pass it explicitly, but with bind any further arguments are automatically forwarded.
When there is only one argument for an arrow function, that one argument can be used directly without any further syntax.
Arrow functions are, as the name suggests,functions defined with a new syntax that uses an“arrow”(=>).
Cannot be called with new- Arrow functions do not have a[[Construct]] method and therefore cannot be used as constructors.
Arrow functions, also known as fat arrow functions are functions that are defined with new syntax that use an arrow(=>).
Knowing that arrow functions cannot be used with new allows JavaScript engines to further optimize their behavior.