Похожие чаты

When you do var b = “Can I access this?”; function bb()

{
var a = “hello”;
console.log(b);
}

bb()

How is the bb function able connected to the variable b?

12 ответов

2 просмотра

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

Charlemagne-Holdt Автор вопроса
Thomas
const a = 1; { const b = 2; { const c = 3;...

So scope is something similar to conceptual classification?

Charlemagne Holdt
So scope is something similar to conceptual classi...

Try learning java you will learn these things better thn anything 😂

Charlemagne-Holdt Автор вопроса
eh
Try learning java you will learn these things bett...

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. ;(

Charlemagne-Holdt Автор вопроса
eh
Try learning java you will learn these things bett...

Espeically writing new functions are hell of headache and naming for the function and objects…

Charlemagne-Holdt Автор вопроса
Thomas
const a = 1; { const b = 2; { const c = 3;...

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.

Charlemagne-Holdt Автор вопроса
Thomas
const a = 1; { const b = 2; { const c = 3;...

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.

Thomas
const a = 1; { const b = 2; { const c = 3;...

that block scoping, wow, we don't even need functions to achieve closures

Thomas
Well this isn't actually closures

but yeah, it has access to the higher scope

Charlemagne-Holdt Автор вопроса
Thomas
const a = 1; { const b = 2; { const c = 3;...

Apart from closures and currying, it looks like JavaScript has literally imported the mathematical concept, functional composition also just called Compose in JavaScript.

Похожие вопросы

Обсуждают сегодня

А еще в перле можно уже @arr1 + @arr2?
Sergei Zhmylove
53
Подскажите, где смотреть результат выполнения программы? Код: ;.686 ;Система команд процессора 686 ;.MODEL FLAT,stdcall ;Модель памяти плоская, станда...
Егор Анелькин
5
I arrived here after a Chico Crypto show highlighted the project & the Team - the fact that the Team had a long history of successfully working with household names gave me e...
Banter is Bullish
1
я не магистр хаскеля, но разве не может лейзи тип конвертнуться в не-лейзи запросив вычисление содержимого прям при инициализации?
deadgnom32 λ madao
100
Привет всем. появился вопрос. Разрабатываю сайт, в данный момент он запущен. Хостинг beget. Добавляю на сайт яндекс метрику с помощью полей client-settings (взято отсюда http...
Andrew
2
;.686 ;Система команд процессора 686 ;.MODEL FLAT,stdcall ;Модель памяти плоская, стандартный ;вызов процедуры ;option casemap:no...
Егор Анелькин
1
Почему у макбука экран не сенсорный?
✨ Anatolii Cherednichenko
28
It's unfortunate that the "Then why are you here" or "lol you must've bought high" mantras always come up. I already tried bringing up this subject in the price channel but si...
Leroy Gerrits
4
Так а кто может спарсить всех участников чата? Идишники
Magic
17
Есть вопрос: допустим есть железка с каким-то интерфейсом(допустим usb), но как по этому интерфейсу железкой управлять неизвестно, прог нету, а управлять очень хочется надо. К...
Mixail Frolov
15
Карта сайта