# Functions with parameters?

**URL:** <https://forum.makecode.com/t/functions-with-parameters/26288>\
**Category:** EV3\
**Created:** [January 23, 2024, 8:02pm UTC](https://forum.makecode.com/t/functions-with-parameters/26288 "2024-01-23T20:02:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vegz78](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/vegz78/32/1201_2.png) [@Vegz78](https://forum.makecode.com/u/Vegz78)\
**Post date:** [January 23, 2024, 8:02pm UTC](https://forum.makecode.com/t/functions-with-parameters/26288/1 "2024-01-23T20:02:06Z")

</div>

Hi,

I cannot figure out how to define functions with parameters in [https://makecode.mindstorms.com](https://makecode.mindstorms.com). Not even in the text based _JavaScript_ tab.

Is this impossible or a good reason for this, or is it just a small fix away, since my understanding is that this is supported both in the STS language, core pxt and all other MakeCode editors?

---

<div class="post-metadata">

**Author:** ![THEb0nny](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/theb0nny/32/3500_2.png) [@THEb0nny](https://forum.makecode.com/u/THEb0nny)\
**Post date:** [January 24, 2024, 1:02am UTC](https://forum.makecode.com/t/functions-with-parameters/26288/2 "2024-01-24T01:02:47Z")

</div>

here are no parameters in the function because the stable version of pxt-ev3 has an old editor core. In the beta version, the kernel is new and there are function parameters.

---

<div class="post-metadata">

**Author:** ![Vegz78](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/vegz78/32/1201_2.png) [@Vegz78](https://forum.makecode.com/u/Vegz78)\
**Post date:** [January 24, 2024, 1:26am UTC](https://forum.makecode.com/t/functions-with-parameters/26288/3 "2024-01-24T01:26:13Z")

</div>

Thanks for your quick reply which was very illuminating and helpful, @THEb0nny!

I was about to ask whether the beta version would ever be published as an updated new stable, but you already answered that here:

> [@Can I download the codes to EV3 via bluetooth?](https://forum.makecode.com/t/can-i-download-the-codes-to-ev3-via-bluetooth/501/35):
>
> Check out the beta version. It’s included there. But it worked on my computer, and when I tried it on the computer at school, for some reason it didn’t work there, but I haven’t figured it out yet. There are a lot of changes in beta. Most likely the beta will never transition to a stable version, because… the developers no longer support the project themselves.

---

<div class="post-metadata">

**Author:** ![Samsano](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/samsano/32/8307_2.png) [@Samsano](https://forum.makecode.com/u/Samsano)\
**Post date:** [January 25, 2024, 10:06pm UTC](https://forum.makecode.com/t/functions-with-parameters/26288/4 "2024-01-25T22:06:04Z")

</div>

Don’t this work?

```auto
function myFunc(param1: number, param2: number) {
     return param1 + param2
}

```

---

<div class="post-metadata">

**Author:** ![Vegz78](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/vegz78/32/1201_2.png) [@Vegz78](https://forum.makecode.com/u/Vegz78)\
**Post date:** [February 15, 2024, 12:51am UTC](https://forum.makecode.com/t/functions-with-parameters/26288/5 "2024-02-15T00:51:09Z")

</div>

Kind of…

It “grey blocks” in the regular edition, but works in JavaScript mode:  
[https://makecode.mindstorms.com/#pub:\_6ozEPCHk1TVA](https://makecode.mindstorms.com/#pub:_6ozEPCHk1TVA)

But works in beta:  
[https://makecode.mindstorms.com/beta/#pub:\_RD04e6e1pD6Y](https://makecode.mindstorms.com/beta/#pub:_RD04e6e1pD6Y)
