{
var a = “hello”;
console.log(b);
}
bb()
How is the bb function able connected to the variable b?
const a = 1; { const b = 2; { const c = 3; { const d = 4; // I have access to: a, b, c, d } // I have access to: a, b, c } // I have access to: a, b } // I have access to: a
So scope is something similar to conceptual classification?
Try learning java you will learn these things better thn anything 😂
No way, I’m going to stop learning programming other than JavaScript and Python. A traditionally more complex maths like linear algebra is way easier than understanding and getting into programming language. ;(
Espeically writing new functions are hell of headache and naming for the function and objects…
So this is about closures right? My instructor is defining what closures is - a function ran. the function executed. It’s never going to execute again. But it’s going to remember that there are references to those variables so the child scope always has access to the parent scope.
Closures - A function ran. The function executed. It’s never going to execute again. But it’s going to remember that there are references to those variables so the child scope always has access to the parent scope.
that block scoping, wow, we don't even need functions to achieve closures
Well this isn't actually closures
but yeah, it has access to the higher scope
Apart from closures and currying, it looks like JavaScript has literally imported the mathematical concept, functional composition also just called Compose in JavaScript.
Обсуждают сегодня