JavaScript Arrow Functions Explained Simply
A concise syntax for creating functions. If we have only one argument, then parentheses around parameters can be omitted. Arrow functions do not have a 'this' context.
const learner = {
name: "Ada",
topics: ["scope", "closures"],
summaries() {
return this.topics.map(topic => this.name + ": " + topic);
}
};
console.log(learner.summaries().join(" | ")); AI panel
Ask AI to clarify the parts you don’t fully understand, or go more in depth with MDN documentation.