We need a loop to check them all, but easier and more efficient way is using built-in JavaScript functions, so we write a function which use filter like below instead
Hepsini kontrol etmek için bir döngüye ihtiyacımız var, ancak yerleşik JavaScript işlevlerini kullanmak daha kolay ve daha verimlidir; bu nedenle, aşağıda gösterildiği gibi bir süzgeç kullanan bir işlev yazıyoruz
This is also why the best way to solve this is to take advantage of closures, which is essentially the idea that in Javascript, inner functions have access to outer variables because inner scopes "enclose" outer scopes.
Bu aynı zamanda, bunu çözmenin en iyi yolunun, Javascript'te iç fonksiyonların dış değişkenlere erişimi olduğu fikri olan kapamalardan yararlanmaktır, çünkü iç kapsamlar, dış kapsamları "kapsamlar".
We need a loop to check them all, but easier and more efficient way is using built-in JavaScript functions, so we write a function which use filter like below instead
Hepsini kontrol etmek için bir döngüye ihtiyacımız var, ancak yerleşik JavaScript işlevlerini kullanmaktan daha kolay ve daha verimli bir yol var, bu nedenle aşağıdakine benzer bir süzgeç kullanan bir işlev yazdık
Since scope-defining construction in JavaScript is a function, not a code block like in many other languages, what we usually mean by closure in JavaScript is a function working with nonlocal variables defined in already executed surrounding function.
JavaScript'te kapsamı tanımlayan yapı bir işlevdir, diğer birçok dilde olduğu gibi bir kod bloğu değil, genellikle ne demek istediğimizi JavaScript'te kapatıyoruz bir daha önce çevreleyen fonksiyonda tanımlanmış olan yerel olmayan değişkenlerle çalışan bir fonksiyondur.
Every function in JavaScript can be considered a closure.
Examples are used only to help you translate the word or expression searched in various contexts. They are not selected or validated by us and can contain inappropriate terms or ideas. Please report examples to be edited or not to be displayed. Potentially sensitive, inappropriate or colloquial translations are usually marked in red or in orange.