, .
, () , ().
, , :
1- : , . ( ). (), . , , , , . , .
let lastName = function (family) {
console.log("My last name is " + family);
};
let x = lastName("Lopez");
ES6:
lastName = (family) => console.log("My last name is " + family);
x = lastName("Lopez");
2 Slow functions: declared functions with the following syntax are not executed immediately. They are "saved for later use" and will be executed later when they are called (called). This type of function works if you call them BEFORE or AFTER where they were defined. If you call the deceleration function to where it was defined - Lift - works correctly.
function Name(name) {
console.log("My cat name is " + name);
}
Name("Chloe");
Lift example:
Name("Chloe");
function Name(name) {
console.log("My cat name is " + name);
}
source
share