| name | functions |
| description | Advanced function patterns including declaration styles, closures, scope chains, hoisting, and this binding. Master function composition and advanced techniques. |
| sasmp_version | 1.3.0 |
| bonded_agent | 02-functions-scope |
| bond_type | PRIMARY_BOND |
| skill_type | reference |
| response_format | code_first |
| max_tokens | 1500 |
| parameter_validation | {"required":["topic"],"optional":["pattern_type"]} |
| retry_logic | {"on_ambiguity":"ask_clarification","fallback":"show_common_patterns"} |
| observability | {"entry_log":"Functions skill activated","exit_log":"Function reference provided"} |
Functions & Scope Skill
Quick Reference Card
Function Styles
function greet(name) { return `Hello, ${name}!`; }
const greet = function(name) { return `Hello, ${name}!`; };
const greet = (name) => `Hello, ${name}!`;
const greet = name => `Hello, ${name}!`;
const getUser = async (id) => await fetch(`/api/${id}`);
Scope Rules
Global Scope
└── Function Scope
└── Block Scope (let/const)
const global = 'accessible everywhere';
function outer() {
const outerVar = 'accessible in outer + inner';
function inner() {
const innerVar = 'only accessible here';
console.(, outerVar, innerVar);
}
}