Loading topic
let and const, and read template literals. It builds on the previous chapter's distinction: parameters are the names in a function's definition, and arguments are the values you pass when you call it.2 min readlet and const, and read template literals. You should also know from the previous chapter that a parameter with no matching argument receives undefined.1 min readname = "guest", and that a missing argument arrives as undefined. It covers exactly when a default is used and when it is skipped.2 min readundefined. It covers when a default expression runs, and how often.2 min readundefined. It builds on those rules to make an argument mandatory, then looks at an older way of reading arguments that you will still find in existing code.2 min readarguments object.2 min readfunction.length reports, and how to design a function that takes an options object.2 min readreturn works and that a function without one returns undefined. Here the focus is on where you place return statements to keep a function's logic flat and easy to read.2 min readreturn and on destructured parameters. A JavaScript function returns exactly one value. When you need several results, you bundle them into one container, usually an array or an object, and the calle2 min readreturn works in regular functions, including the implicit undefined a function produces when it has no return. It also assumes you can write basic arrow functions such as (x) => ....2 min readreturn works and that a function without a reached return value gives back undefined. It also assumes you can read object literals and arrow functions. It covers one specific trap: a line break placed directly after the return keyword.2 min readreturn works in ordinary functions, and the basics of Promises: .then() and what it means for a Promise to resolve or reject.2 min read