The backstage label uses a shared site name and a section name that only exists inside the label function. Run script.js and inspect both labels in the Console.
Scope decides where a variable can be used. This lesson shows one global value, one local value, and a function that combines them into a single label.
const gardenName = "East Garden";
function describePlot() {
const plotName = "Herbs";
return `${gardenName}: ${plotName}`;
}
console.log(describePlot());
siteName as "Frontend Lab"; in buildLabel() create local sectionName as "Variables", return their joined label.Frontend Lab - Variables from buildLabel().Use the global siteName inside your function.
Create a local sectionName inside the function and return a combined string.