# Closure

Published articles for Closure.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## What's New in PHP 8.6

DevFeed: [What's New in PHP 8.6](<https://devfeed.tech/articles/what-s-new-in-php-8-6-26631.md>)

Original publisher: [Read original article](<https://laravel-news.com/php-8-6>)

Author: Paul Redmond

Published: 2026-09-15T03:00:09Z

Content type: release

Language: en

Sources: [Laravel](<https://devfeed.tech/sources/laravel.md>)

Topics: [PHP](<https://devfeed.tech/topics/php.md>), [DateTime](<https://devfeed.tech/topics/datetime.md>), [ISO 8601](<https://devfeed.tech/topics/iso-8601.md>)

Tags: [2026](<https://devfeed.tech/tags/2026.md>), [closure](<https://devfeed.tech/tags/closure.md>), [feature](<https://devfeed.tech/tags/feature.md>), [function](<https://devfeed.tech/tags/function.md>), [interface](<https://devfeed.tech/tags/interface.md>), [iso](<https://devfeed.tech/tags/iso.md>), [news](<https://devfeed.tech/tags/news.md>), [php](<https://devfeed.tech/tags/php.md>), [php-8-6](<https://devfeed.tech/tags/php-8-6.md>), [precision](<https://devfeed.tech/tags/precision.md>), [properties](<https://devfeed.tech/tags/properties.md>), [release](<https://devfeed.tech/tags/release.md>)

### AI overview

An overview of PHP 8.6, scheduled for release on November 19, 2026. The article covers partial function application, the clamp() function, a nanosecond-precision Duration class, readonly property defaults, and parameter DocComments, along with the release timeline and related changes.

### Source excerpt

PHP 8.6 arrives November 19, 2026 with partial function application, a clamp() function, a Duration class, readonly property defaults, and new deprecations. The post What's New in PHP 8.6 appeared first on Laravel News. Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.

## Partial Function Application is coming in PHP 8.6

DevFeed: [Partial Function Application is coming in PHP 8.6](<https://devfeed.tech/articles/partial-function-application-is-coming-in-php-8-6-20473.md>)

Original publisher: [Read original article](<https://www.amitmerchant.com/partial-function-application-php-86/>)

Author: Amit Merchant

Published: 2025-12-05T00:00:00Z

Content type: tutorial

Language: en

Sources: [Amit Merchant](<https://devfeed.tech/sources/amit-merchant.md>)

Topics: [PHP](<https://devfeed.tech/topics/php.md>), [PHP 8.6](<https://devfeed.tech/topics/php-8-6.md>), [Code](<https://devfeed.tech/topics/code.md>), [servers](<https://devfeed.tech/topics/servers.md>)

Tags: [argument](<https://devfeed.tech/tags/argument.md>), [authorization](<https://devfeed.tech/tags/authorization.md>), [callback](<https://devfeed.tech/tags/callback.md>), [closure](<https://devfeed.tech/tags/closure.md>), [function](<https://devfeed.tech/tags/function.md>), [http](<https://devfeed.tech/tags/http.md>), [parameter](<https://devfeed.tech/tags/parameter.md>), [php](<https://devfeed.tech/tags/php.md>), [php-8-6](<https://devfeed.tech/tags/php-8-6.md>), [request](<https://devfeed.tech/tags/request.md>), [types](<https://devfeed.tech/tags/types.md>)

### AI overview

This tutorial introduces Partial Function Application in PHP 8.6. It explains how placeholders create pre-configured Closures, covers multiple holes, named and variadic arguments, and shows a practical example for adding an Authorization header to HTTP requests.

### Source excerpt

Ever reach for a simple callback and end up writing a tiny novella--an arrow function stuffed with types, reordered parameters, and boilerplate just to pass one value through?

## 10 Interview Questions Every JavaScript Developer Should Know in 2024

DevFeed: [10 Interview Questions Every JavaScript Developer Should Know in 2024](<https://devfeed.tech/articles/10-interview-questions-every-javascript-developer-should-know-in-2024-20711.md>)

Original publisher: [Read original article](<https://medium.com/javascript-scene/10-interview-questions-every-javascript-developer-should-know-in-2024-c1044bcb0dfb?source=rss----c0aeac5284ad---4>)

Author: Eric Elliott

Published: 2023-12-31T01:38:10Z

Content type: tutorial

Language: en

Sources: [Eric Elliot](<https://devfeed.tech/sources/eric-elliot.md>)

Topics: [JavaScript](<https://devfeed.tech/topics/javascript.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>), [Functional programming](<https://devfeed.tech/topics/functional-programming.md>)

Tags: [career](<https://devfeed.tech/tags/career.md>), [closure](<https://devfeed.tech/tags/closure.md>), [developer](<https://devfeed.tech/tags/developer.md>), [guide](<https://devfeed.tech/tags/guide.md>), [hiring](<https://devfeed.tech/tags/hiring.md>), [interview](<https://devfeed.tech/tags/interview.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [react](<https://devfeed.tech/tags/react.md>), [tdd](<https://devfeed.tech/tags/tdd.md>), [technology](<https://devfeed.tech/tags/technology.md>), [typescript](<https://devfeed.tech/tags/typescript.md>)

### AI overview

A guide to JavaScript interview questions covering closures, pure functions, test-driven development, and related programming concepts. It also discusses how interviewers may assess learning aptitude alongside technical knowledge.

### Source excerpt

The world of JavaScript has evolved significantly, and interview trends have changed a lot over the years. This guide features 10 essential questions that every JavaScript developer should know the answers to in 2024. It covers a range of topics from closures to TDD, equipping you with the knowledge and confidence to tackle modern JavaScript challenges. As a hiring manager, I use all of these questions in real technical interviews on a regular basis. When engineers don't know the answers, I don't automatically reject them. Instead, I teach them the concepts and get a sense of how well they listen, and learn, and deal with the stressful situation of not knowing the answer to an interview question. A good interviewer is looking for people who are eager to learn and advance their understanding and their career. If I'm hiring for a less experienced role, and the candidate fails all of these questions, but demonstrates a good aptitude for learning, they may still land the job! 1. What is a Closure? A closure gives you access to an outer function's scope from an inner function. When functions are nested, the inner functions have access to the variables declared in the outer function scope, even after the outer function has returned: const createSecret = (secret) => { return { getSecret: () => secret, setSecret: (newSecret) => { secret = newSecret; }, }; }; const mySecret = createSecret("My secret"); console.log(mySecret.getSecret()); // My secret mySecret.setSecret("My new secret"); console.log(mySecret.getSecret()); // My new secret Closure variables are live references to the outer-scoped variable, not a copy. This means that if you change the outer-scoped variable, the change will be reflected in the closure variable, and vice versa, which means that other functions declared in the same outer function will have access to the changes. Common use cases for closures include: Data privacy Currying and partial applications (frequently used to improve function composition, e

## Lambdas and Function References

DevFeed: [Lambdas and Function References](<https://devfeed.tech/articles/lambdas-and-function-references-25059.md>)

Original publisher: [Read original article](<https://typealias.com/start/kotlin-lambdas/>)

Author: author@typealias.com (Dave Leeds)

Published: 2022-02-28T00:00:00Z

Content type: tutorial

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [closure](<https://devfeed.tech/tags/closure.md>), [code](<https://devfeed.tech/tags/code.md>), [function](<https://devfeed.tech/tags/function.md>), [function-reference](<https://devfeed.tech/tags/function-reference.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [lambda](<https://devfeed.tech/tags/lambda.md>), [learn-to-program](<https://devfeed.tech/tags/learn-to-program.md>), [programming](<https://devfeed.tech/tags/programming.md>), [types](<https://devfeed.tech/tags/types.md>)

### AI overview

A tutorial introduction to Kotlin lambdas, function types, and function references, using a barber-shop pricing example involving coupons and tax.

### Source excerpt

As we've seen, functions are a basic building block of Kotlin code. Throughout this book, we've written a lot of them, all using the fun keyword. Kotlin also gives us another way to write functions--lambdas! To help us learn about function types, function references, and lambdas, we'll need to pay a visit to Bert's Snips & Clips. Bert's Snips & Clips Bert's Snips & Clips is the barber shop to go to for a clean haircut and a nice smooth shave.

## Swift Closures in Kotlin Multiplatform - Ben Whitley

DevFeed: [Swift Closures in Kotlin Multiplatform - Ben Whitley](<https://devfeed.tech/articles/swift-closures-in-kotlin-multiplatform-ben-whitley-38323.md>)

Original publisher: [Read original article](<https://touchlab.co/swift-closures-kotlin-multiplatform>)

Published: 2020-06-11T19:11:25Z

Content type: tutorial

Language: en

Sources: [Touchlab | Enterprise Mobile Innovation & Development](<https://devfeed.tech/sources/touchlab-enterprise-mobile-innovation-development.md>)

Topics: [Kotlin Multiplatform](<https://devfeed.tech/topics/kotlin-multiplatform.md>), [Closure](<https://devfeed.tech/topics/closure.md>), [Swift](<https://devfeed.tech/topics/swift.md>), [iOS](<https://devfeed.tech/topics/ios.md>), [ui](<https://devfeed.tech/topics/ui.md>)

Tags: [closure](<https://devfeed.tech/tags/closure.md>), [code-sharing](<https://devfeed.tech/tags/code-sharing.md>), [cycles](<https://devfeed.tech/tags/cycles.md>), [ios](<https://devfeed.tech/tags/ios.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [swift](<https://devfeed.tech/tags/swift.md>), [ui](<https://devfeed.tech/tags/ui.md>)

### AI overview

This tutorial explains how Swift closures are used on the iOS side of Kotlin Multiplatform projects and how they can create strong reference cycles. It describes how Automatic Reference Counting manages memory and why weak references to self may be needed when a closure captures a ViewController.

### Source excerpt

When working on the iOS side of Kotlin Multiplatform, it's helpful to understand Swift closures to update UI and avoid strong reference cycles.

## Delegates vs Closure Callbacks

DevFeed: [Delegates vs Closure Callbacks](<https://devfeed.tech/articles/delegates-vs-closure-callbacks-25806.md>)

Original publisher: [Read original article](<https://www.steveonstuff.com/2018/08/16/delegates-vs-closure-callbacks>)

Author: Steve Barnegren

Published: 2018-08-16T00:00:00Z

Content type: comparison

Language: en

Sources: [Steve Barnegren](<https://devfeed.tech/sources/steve-barnegren.md>)

Topics: [Swift](<https://devfeed.tech/topics/swift.md>), [Objective-C](<https://devfeed.tech/topics/objective-c.md>)

Tags: [callback](<https://devfeed.tech/tags/callback.md>), [closure](<https://devfeed.tech/tags/closure.md>), [compare](<https://devfeed.tech/tags/compare.md>), [delegates](<https://devfeed.tech/tags/delegates.md>), [objective-c](<https://devfeed.tech/tags/objective-c.md>), [patterns](<https://devfeed.tech/tags/patterns.md>), [swift](<https://devfeed.tech/tags/swift.md>)

### AI overview

This comparison examines delegate and closure callback patterns in Swift, focusing on retain-cycle handling and managing callbacks from multiple instances. It finds delegates safer for weak-reference relationships, while closure callbacks are clearer when separating callbacks for multiple instances.

### Source excerpt

Remember how awesome the delegate pattern was in Objective-C? Enabling classes to be super reusable by delegating out the bits that you might want control over. There's a reason that it's so ubiquitous across Cocoa Touch, it's just so damn good!

## Helpful: Adding Contextual Help to Emacs

DevFeed: [Helpful: Adding Contextual Help to Emacs](<https://devfeed.tech/articles/helpful-adding-contextual-help-to-emacs-22018.md>)

Original publisher: [Read original article](<http://www.wilfred.me.uk/blog/2017/08/30/helpful-adding-contextual-help-to-emacs/>)

Author: Wilfred Hughes

Published: 2017-08-30T00:00:00Z

Content type: release

Language: en

Sources: [Wilfred Hughes](<https://devfeed.tech/sources/wilfred-hughes.md>)

Topics: [Emacs](<https://devfeed.tech/topics/emacs.md>), [Code](<https://devfeed.tech/topics/code.md>), [debug](<https://devfeed.tech/topics/debug.md>)

Tags: [closure](<https://devfeed.tech/tags/closure.md>), [code](<https://devfeed.tech/tags/code.md>), [debug](<https://devfeed.tech/tags/debug.md>), [emacs](<https://devfeed.tech/tags/emacs.md>), [files](<https://devfeed.tech/tags/files.md>), [function](<https://devfeed.tech/tags/function.md>), [source](<https://devfeed.tech/tags/source.md>)

### AI overview

The article announces Helpful v0.1, an Emacs package that adds contextual help for functions and symbols. It reports keybindings across keymaps, discoverable debugging actions, focused and fontified docstrings, symbol references through elisp-refs, and source recovery or formatting for interactively defined, closure, and byte-compiled functions.

### Source excerpt

I've just released Helpful, a new way of getting help in Emacs! The *Help* built-in to Emacs is already pretty good. Helpful goes a step further and includes lots of contextual info. Let's take a look. Have you ever wondered which major modes have a keybinding for a function? Helpful reports keybindings in all keymaps! When you're hacking on some new code, you might end up with old function aliases after renaming a function. Helpful provides discoverable debug buttons, so you don't need to remember fmakunbound. Helpful also has strong opinions on viewing docstrings. Summaries are given focus, and text is fontified. We solve the text-quoting-style debate by removing superfluous puncuation entirely. Helpful will even show all the references to the symbol you're looking at, using elisp-refs. This is great for understanding how and where a function is used. Finally, Helpful will rifle through your Emacs instance to find source code to functions: If you've defined a function interactively, Helpful will use edebug properties to find the source code. If Emacs can only find the raw closure, helpful will convert it back to an equivalent defun. If Emacs can only find the byte-compiled files, helpful will just pretty-print that. I've just released v0.1, so there will be bugs. Please give it a try, and let me know what you think, or how we can make it even more, well, helpful!

## ES6 IIFE with fat arrow functions

DevFeed: [ES6 IIFE with fat arrow functions](<https://devfeed.tech/articles/es6-iife-with-fat-arrow-functions-32301.md>)

Original publisher: [Read original article](<https://jack.ofspades.com/es6-iife-with-fat-arrow-functions/>)

Author: Jack Tarantino

Published: 2015-11-29T17:45:39Z

Content type: tutorial

Language: en

Sources: [Jacopo Tarantino](<https://devfeed.tech/sources/jacopo-tarantino.md>)

Topics: [es6](<https://devfeed.tech/topics/es6.md>), [es2015](<https://devfeed.tech/topics/es2015.md>), [function](<https://devfeed.tech/topics/function.md>), [syntax](<https://devfeed.tech/topics/syntax.md>)

Tags: [best-practices](<https://devfeed.tech/tags/best-practices.md>), [closure](<https://devfeed.tech/tags/closure.md>), [context](<https://devfeed.tech/tags/context.md>), [es2015](<https://devfeed.tech/tags/es2015.md>), [es6](<https://devfeed.tech/tags/es6.md>), [function](<https://devfeed.tech/tags/function.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [syntax](<https://devfeed.tech/tags/syntax.md>)

### AI overview

This tutorial explains how to write Immediately Invoked Function Expressions (IIFEs) in ES6 using fat arrow functions. It compares shorter syntax options, notes differences in function context, and describes a compact form for creating closures that cannot accept arguments.

### Source excerpt

Writing Immediately Invoked Function Expressions or IIFEs in ES6(Also known as ES2015 now) just got a lot easier with the introduction of fat arrow functions. (global => { const MY_CONSTANT = 'api key or something' let counter = 0 let some_array = [1,2,34,5,6,7] counter = some_array.

## Pitfalls With Closures In Go

DevFeed: [Pitfalls With Closures In Go](<https://devfeed.tech/articles/pitfalls-with-closures-in-go-22103.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2014/06/pitfalls-with-closures-in-go.html>)

Published: 2014-06-20T00:00:00Z

Content type: tutorial

Language: en

Sources: [William Kennedy](<https://devfeed.tech/sources/william-kennedy.md>)

Topics: [Go Language](<https://devfeed.tech/topics/go-language.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [ardan-labs](<https://devfeed.tech/tags/ardan-labs.md>), [blog](<https://devfeed.tech/tags/blog.md>), [closure](<https://devfeed.tech/tags/closure.md>), [code](<https://devfeed.tech/tags/code.md>), [function](<https://devfeed.tech/tags/function.md>), [go](<https://devfeed.tech/tags/go.md>), [go-programming](<https://devfeed.tech/tags/go-programming.md>), [golang](<https://devfeed.tech/tags/golang.md>), [pitfalls](<https://devfeed.tech/tags/pitfalls.md>), [programming](<https://devfeed.tech/tags/programming.md>), [range](<https://devfeed.tech/tags/range.md>), [scope](<https://devfeed.tech/tags/scope.md>), [variable](<https://devfeed.tech/tags/variable.md>)

### AI overview

This tutorial explains how closures in Go can cause bugs when variables from a for-range loop are used inside goroutines. It examines which variables are passed as function parameters and which are captured through closures.

### Source excerpt

Introduction Closures in Go are a very powerful construct but they can also be the cause of bugs if you don't understand how they work. In this post I am going to pull a small piece of code from Chapter 2 from the Go In Action book that discusses a pitfall you can run into when using closures. The full code example can be found in the Github repository for the book. Chapter 2 discusses this code example in full detail. The Closure Pitfall First let's look at the piece of code:

## Why I Test Private Functions In JavaScript

DevFeed: [Why I Test Private Functions In JavaScript](<https://devfeed.tech/articles/why-i-test-private-functions-in-javascript-29534.md>)

Original publisher: [Read original article](<https://philipwalton.com/articles/why-i-test-private-functions-in-javascript/>)

Published: 2013-07-17T15:47:00Z

Content type: opinion

Language: en

Sources: [Philip Walton](<https://devfeed.tech/sources/philip-walton.md>)

Topics: [JavaScript](<https://devfeed.tech/topics/javascript.md>), [Unit testing](<https://devfeed.tech/topics/unit-testing.md>), [Testing](<https://devfeed.tech/topics/testing.md>)

Tags: [behavior](<https://devfeed.tech/tags/behavior.md>), [closure](<https://devfeed.tech/tags/closure.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [testing](<https://devfeed.tech/tags/testing.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>)

### AI overview

The author explains why they test some JavaScript code inside closures, responding to criticism that testing private functions is unnecessary or indicates poor design. They clarify that they are not advocating testing every private function or claiming that developers who disagree are wrong.

### Source excerpt

Last week I published an article on this blog entitled How to Unit Test Private Functions in JavaScript. The article was well received and even mentioned in a few popular newsletters (most notably JavaScript Weekly). Still, a decent amount of the feedback I received in the comments and on Twitter strongly disagreed with my approach. The most common criticism was: unit testing private functions is unnecessary and a mark of bad design.

## Understanding this in JavaScript Objects, Inner Functions, and Callbacks

DevFeed: [Understanding this in JavaScript Objects, Inner Functions, and Callbacks](<https://devfeed.tech/articles/javascript-objects-and-what-is-this-35421.md>)

Original publisher: [Read original article](<https://darkcoding.net/software/javascript-objects-and-what-is-this/>)

Author: Graham King

Published: 2009-02-23T02:06:41Z

Content type: tutorial

Language: en

Sources: [Graham King](<https://devfeed.tech/sources/graham-king.md>)

Topics: [JavaScript](<https://devfeed.tech/topics/javascript.md>), [callback](<https://devfeed.tech/topics/callback.md>), [bug](<https://devfeed.tech/topics/bug.md>)

Tags: [bug](<https://devfeed.tech/tags/bug.md>), [callback](<https://devfeed.tech/tags/callback.md>), [closure](<https://devfeed.tech/tags/closure.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [local-variables](<https://devfeed.tech/tags/local-variables.md>), [scope](<https://devfeed.tech/tags/scope.md>), [software](<https://devfeed.tech/tags/software.md>), [window](<https://devfeed.tech/tags/window.md>)

### AI overview

This tutorial explains how JavaScript's this behaves in object methods, inner functions, and callbacks. It shows how object context can be lost and how closures and local variables can preserve access to the intended object.

### Source excerpt

"Navigate the tricky waters of 'this' in JavaScript objects and callbacks."