Sitemap

Lambda

1 min readDec 9, 2020

Actions are type void and returns are type functions (or func). This is important to distinguish when using delegates. Lambdas allow you to avoid having to use a dedicated method. This minimizes the amount of code you write and it also enables you to add logic. I was a little confused at an example that was given. If you are calling a return, you would have to call a func method. In the example below, it shows that we are calling an action in type void. Hmm, curious.

Press enter or click to view image in full size

Anyways, I am enjoying the use of Lambdas. It allows for clear and compact coding. I also found it interesting that when there are no parameters, you still include the parenthesis but without anything in between. I am starting to understand the language of coding. When I look at different scripts, I am able to navigate my way through and articulate what is being executed. I don’t know if this is because I am getting older, but this is my idea of fun lol….On that note, good night. :P

--

--

Selina Lalau
Selina Lalau

Written by Selina Lalau

A coconut girl in a tech savvy world.

No responses yet