Functional alternatives — pass context, closures, tiny helpers
Avoid this by passing data explicitly, using closures and small helpers; write tiny, readable functions.
Why functional alternatives?
Goal: Skip this when it adds confusion.
- Pure functions: pass data as params
- Closures: capture once, reuse
- Tiny factory functions
- Small, readable helpers for beginners

Pure function over this
A pure function reads inputs and returns a value. No hidden this, easier to test.
// Pure function: takes data as parameters
function fullName(user) {
// no this; explicit inputs
return user.first + " " + user.last;
}
const u = { first: "Ayla", last: "Kaya" };
console.log("fullName:", fullName(u));

All lessons in this course
- Lexical vs dynamic this, arrows revisited
- Method extraction gotchas, partial application
- Functional alternatives — pass context, closures, tiny helpers