# Is it possible to make lambdas in makecode?

**URL:** https://forum.makecode.com/t/is-it-possible-to-make-lambdas-in-makecode/46014
**Category:** Help
**Tags:** extension, graphics-and-math
**Created:** [September 21, 2026, 10:15pm UTC](https://forum.makecode.com/t/is-it-possible-to-make-lambdas-in-makecode/46014 "2026-09-21T22:15:47Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Cybercube](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cybercube/32/34628_2.png) [@Cybercube](https://forum.makecode.com/u/Cybercube)
#### Post date: [September 21, 2026, 10:15pm UTC](https://forum.makecode.com/t/is-it-possible-to-make-lambdas-in-makecode/46014/1 "2026-09-21T22:15:47Z")

</div>

I’m just seeing if it possible to make lambdas\[1\] in makecode arcade?  
Like inputs with blocks in it that you can use to execute code inputs with inputs?

* * *

1. Anonymous function - Wikipedia

---

<div class="post-metadata">

### Author: ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)
#### Post date: [September 21, 2026, 10:22pm UTC](https://forum.makecode.com/t/is-it-possible-to-make-lambdas-in-makecode/46014/2 "2026-09-21T22:22:00Z")

</div>

Lambda syntax is perfectly valid in JavaScript / TypeScript. Blocks also can accept anonymous functions, but the anonymous functions cannot return values.

See the event handler example at the bottom of the **Types of Blocks** examples in the _MakeCode Blocks Playground_:

> **[MakeCode Blocks Playground](https://makecode.com/playground#basic-types)**

Also refer to the **Callbacks with Parameters** section of the official documentation:

> **[Defining blocks](https://makecode.com/defining-blocks)**
>
> This section describes how to annotate your MakeCode APIs to expose them in the Block Editor.

---

<div class="post-metadata">

### Author: ![Cybercube](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cybercube/32/34628_2.png) [@Cybercube](https://forum.makecode.com/u/Cybercube)
#### Post date: [September 21, 2026, 10:47pm UTC](https://forum.makecode.com/t/is-it-possible-to-make-lambdas-in-makecode/46014/3 "2026-09-21T22:47:21Z")

</div>

> [@AlexK](#):
>
> Lambda syntax is perfectly valid in JavaScript / TypeScript. Blocks also can accept anonymous functions, but the anonymous functions cannot return values.

how about variables for return values?

---

<div class="post-metadata">

### Author: ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)
#### Post date: [September 21, 2026, 11:28pm UTC](https://forum.makecode.com/t/is-it-possible-to-make-lambdas-in-makecode/46014/4 "2026-09-21T23:28:51Z")

</div>

@Cybercube you can store things in variables for return values but since all variables in blocks are global it can get pretty tricky. very easy to accidentally overwrite your return value when something gets called recursively.

there is exactly one block that takes lamdas with a return value and it’s [pause until](https://forum.makecode.com/t/richards-arcade-tips-3-the-pause-until-block/28794), but it’s built-in to makecode (there’s no way to replicate its behavior in an extension).

the closest thing you can do is define blocks that take an anonymous function as alex mentioned. you could always make your own return block i guess, something like this:

> **[block lamdas?](https://arcade.makecode.com/54239-24836-26818-10231)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

but it’s pretty gross

---

<div class="post-metadata">

### Author: ![mrbananaguy1234](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@mrbananaguy1234](https://forum.makecode.com/u/mrbananaguy1234)
#### Post date: [September 22, 2026, 6:02pm UTC](https://forum.makecode.com/t/is-it-possible-to-make-lambdas-in-makecode/46014/5 "2026-09-22T18:02:06Z")

</div>

[https://arcade.makecode.com/S20674-28238-44942-14640](https://arcade.makecode.com/S20674-28238-44942-14640) here you go
