# let() (scope function)

DevFeed: [let() (scope function)](<https://devfeed.tech/articles/let-scope-function-25019.md>)

Original publisher: [Read original article](<https://typealias.com/concepts/let/>)

Author: author@typealias.com (Dave Leeds)

Published: 2017-09-04T19:54:18Z

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>), [Library](<https://devfeed.tech/topics/library.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [extension-function](<https://devfeed.tech/tags/extension-function.md>), [function-reference](<https://devfeed.tech/tags/function-reference.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-standard-library](<https://devfeed.tech/tags/kotlin-standard-library.md>), [lambda](<https://devfeed.tech/tags/lambda.md>), [let](<https://devfeed.tech/tags/let.md>), [programming](<https://devfeed.tech/tags/programming.md>), [receiver](<https://devfeed.tech/tags/receiver.md>), [scope](<https://devfeed.tech/tags/scope.md>), [scope-function](<https://devfeed.tech/tags/scope-function.md>), [transformation](<https://devfeed.tech/tags/transformation.md>)

## AI overview

A reference guide to Kotlin's let() scope function. It explains how the receiver object is passed as the lambda argument, how let() returns the code block's result, and how it can transform objects. It also compares let() with direct property or function access, extension functions, and map().

## Source excerpt

Overview The let() function is one of a handful of scope functions defined in the Kotlin standard library. Example val size = "Hello".let { println(it) it.length } In this example, the string "Hello" is printed, and then its length is assigned to the size variable. Characteristics When the let() extension function executes: the receiver object that .let() is called upon is available as the lambda argument - by default, named it the result of let() will be the result of the code block passed to it Transformation The let() method is frequently used to transform an object.