Kotlin Unpacking Params

Chetan Gupta
4 min readJul 31, 2019

Destructuring Declarations in Kotlin

De-structuring at its core a syntactic sugar to easily unpack parameters out of an object or array and declare local all in one shot.

Don’t miss out on the course on Generative AI using Kotlin, Jetpack Compose, Langchain4j, and Ollama. You will learn hands-on by building 6 AI apps. Join now for lifetime access, but hurry — prices increase after July 1st!

NOTE: As of Dec-14/20 Medium Github Snippets aren’t working properly, please read the article from my official site if it stays broken.

Basically instead of doing this :

--

--

Chetan Gupta
Chetan Gupta

Written by Chetan Gupta

Android & Kotlin Expert | Training & Technical writing for Bussiness contact https://t.me/ch810

No responses yet