# Making an extension for every JavaScript exclusive feature I can think of!

**URL:** https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766
**Category:** Arcade
**Tags:** extension
**Created:** [May 19, 2025, 1:32am UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766 "2025-05-19T01:32:23Z")
**Posts on this page:** 19
**Page:** 5

<div class="post-metadata">

### Author: ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)
#### Post date: [August 9, 2026, 1:56am UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/81 "2026-08-09T01:56:41Z")

</div>

Looks like any function that takes in a function and returns a value will have to wait. It seems support for that sort of block is… only halfway baked. Here are some screenshots of my suffering:

 ![Screenshot 2026-08-08 at 2.31.51 AM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/2/0/202e850ab51f40cf715a70898770693cc2065325.png)  
Adding `//% draggableParameters="reporter"` results in this classic issue:  
 ![Screenshot 2026-08-08 at 2.58.24 AM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/6/c/6cf67c16fd8f8e16ee7323b1523bd4b6f3d8649f.png)  
Then I just ignored those and tried to get it working and it seems that it just forgets that the block is supposed to add the code inside to the javaScript half of the equation entirely and resulted in a error in blocks that didn’t stop the game from running and wasn’t an error once switched to javaScript:  
 ![Screenshot 2026-08-08 at 2.51.29 AM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/2/7/2728ddfdfa89ca9603cb175d3d2f2fbac64fcc3c.png)  
Anyways yeah. Some absolutely cursed looking blocks here. @richard if you have any advice, it is more than welcome! I’ve tried every permutation of having and not having certain parts of this, but here is all of stuff I’ve tried written into one block:

```auto
    /**
     * Returns true if any element of an array makes the code return true.
     */
    //% blockID="extras_some_array"
    //% block="some $target=variables_get(list) $value=variables_get(value) $index=variables_get(index)"
    //% group="Operations"
    //% draggableParameters="reporter" // This would be required for the block I want but does not work.
    //% handlerStatement // idk I thought it might do something. It didn't.
    //% blockNamespace="arrays"
    export function some_array_block(target: Array<any>, condition: (value: any, index: number)=>boolean) {
        return target.some(condition) // This would be ideal but I have tried the other one and it's not working either it seems.
        //target.some(condition)
    }

```

---

<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: [August 9, 2026, 2:04am UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/82 "2026-08-09T02:04:33Z")

</div>

Ooh … yeah … returning a value from a container appears not to be supported. Don’t know if that’s a limitation of the underlying Blockly framework or if it’s something that could be tweaked within MakeCode. Looking forward to hearing what Richard thinks. Sorry about the wild goose chase, WoofWoof!

---

<div class="post-metadata">

### Author: ![CodaKnight](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codaknight/32/33491_2.png) [@CodaKnight](https://forum.makecode.com/u/CodaKnight)
#### Post date: [August 9, 2026, 7:59pm UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/83 "2026-08-09T19:59:18Z")

</div>

Yep, lol, tried to create a block that let’s you create you’re math function and then be able to return your value. Sadly, didn’t work and richard said something about this too about it.

---

<div class="post-metadata">

### Author: ![CodaKnight](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codaknight/32/33491_2.png) [@CodaKnight](https://forum.makecode.com/u/CodaKnight)
#### Post date: [August 9, 2026, 8:06pm UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/84 "2026-08-09T20:06:56Z")

</div>

Hey @WoofWoof maybe you can expose Number.Epsilon and Number.isNan()

---

<div class="post-metadata">

### Author: ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)
#### Post date: [August 9, 2026, 8:08pm UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/85 "2026-08-09T20:08:13Z")

</div>

Well the others will certainly be possible!  
They probably have never set up that functionality because they never had a block that needed it… so probably it won’t ever be set up but that’s alright.

---

<div class="post-metadata">

### Author: ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)
#### Post date: [August 10, 2026, 4:28am UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/86 "2026-08-10T04:28:46Z")

</div>

Well that was easy!

 ![Screenshot 2026-08-09 at 4.16.56 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/8/9/89136115712dcbc6fa9b04428c369f461b4a8021.png)  
About your other suggestion, just use negative numbers in the slot.  
 ![Screenshot 2026-08-09 at 4.18.53 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/b/3/b3884d067bb0555246b4e2bdc0a61a309a6dacb3.png)

None of these blocks are published in the extension yet though, you’ll have to wait just a bit.

---

<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: [August 10, 2026, 4:39pm UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/87 "2026-08-10T16:39:32Z")

</div>

definitely not supported!

---

<div class="post-metadata">

### Author: ![CodaKnight](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codaknight/32/33491_2.png) [@CodaKnight](https://forum.makecode.com/u/CodaKnight)
#### Post date: [August 10, 2026, 6:02pm UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/88 "2026-08-10T18:02:26Z")

</div>

I don’t really know if this is possible when coding the extension, but do you think it’s possible to add like these types of arrays (I forgot what they’re called 🤣) for blocks?

```typescript
let characterKeys: CharacterKey[] = [ // CharacterKey is an interface 

    { key: browserEvents.A, character: "a", wasPressed: false },

    { key: browserEvents.B, character: "b", wasPressed: false },

    { key: browserEvents.C, character: "c", wasPressed: false },

    { key: browserEvents.D, character: "d", wasPressed: false },

    { key: browserEvents.E, character: "e", wasPressed: false },

    { key: browserEvents.F, character: "f", wasPressed: false },

    { key: browserEvents.G, character: "g", wasPressed: false },

    { key: browserEvents.H, character: "h", wasPressed: false },

    { key: browserEvents.I, character: "i", wasPressed: false },

    { key: browserEvents.J, character: "j", wasPressed: false },

    { key: browserEvents.K, character: "k", wasPressed: false },

    { key: browserEvents.L, character: "l", wasPressed: false },

    { key: browserEvents.M, character: "m", wasPressed: false },

    { key: browserEvents.N, character: "n", wasPressed: false },

    { key: browserEvents.O, character: "o", wasPressed: false },

    { key: browserEvents.P, character: "p", wasPressed: false },

    { key: browserEvents.Q, character: "q", wasPressed: false },

    { key: browserEvents.R, character: "r", wasPressed: false },

    { key: browserEvents.S, character: "s", wasPressed: false },

    { key: browserEvents.T, character: "t", wasPressed: false },

    { key: browserEvents.U, character: "u", wasPressed: false },

    { key: browserEvents.V, character: "v", wasPressed: false },

    { key: browserEvents.W, character: "w", wasPressed: false },

    { key: browserEvents.X, character: "x", wasPressed: false },

    { key: browserEvents.Y, character: "y", wasPressed: false },

    { key: browserEvents.Z, character: "z", wasPressed: false },

    { key: browserEvents.Space, character: " ", wasPressed: false }

]

```

---

<div class="post-metadata">

### Author: ![jwunderl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jwunderl/32/5308_2.png) [@jwunderl](https://forum.makecode.com/u/jwunderl)
#### Post date: [August 10, 2026, 6:04pm UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/89 "2026-08-10T18:04:18Z")

</div>

(object literals) (not possible but you can use e.g. sprite data or [microsoft/arcade-block-objects: An extension for MakeCode Arcade that adds JavaScript like objects](https://github.com/microsoft/arcade-block-objects/) to match the behavior close enough)

---

<div class="post-metadata">

### Author: ![CodaKnight](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codaknight/32/33491_2.png) [@CodaKnight](https://forum.makecode.com/u/CodaKnight)
#### Post date: [August 11, 2026, 4:48pm UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/90 "2026-08-11T16:48:51Z")

</div>

Also, I just added a few blocks for you @WoofWoof to add to your extension:

> **[TypeScriptExtras TESTING EXTENSION](https://arcade.makecode.com/S14664-57578-56983-43906)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

Blocks included:

- Infinity
- negative Infinitiy
- isFinite
- non-null assertion
- optional chaining
- nullish coalescing
- is array
- is sprite
- text includes
- text starts with
- text ends with
- Boolean conversion
- String conversion

---

<div class="post-metadata">

### Author: ![CodaKnight](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codaknight/32/33491_2.png) [@CodaKnight](https://forum.makecode.com/u/CodaKnight)
#### Post date: [August 11, 2026, 9:01pm UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/91 "2026-08-11T21:01:12Z")

</div>

Also @WoofWoof , I’m going to be creating an extension from these blocks with obv, a different name since I have some other blocks I’m going to be adding such as unknown.

---

<div class="post-metadata">

### Author: ![VoxelMaster64](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/voxelmaster64/32/32075_2.png) [@VoxelMaster64](https://forum.makecode.com/u/VoxelMaster64)
#### Post date: [August 12, 2026, 2:20am UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/92 "2026-08-12T02:20:45Z")

</div>

do you have typeof(…) yet (though I forget if that returns a type or a number)? It would Also be cool if you made a typeTo(n: any, type: type) { return n as type } which is:

```typescript
function typeTo<T>(n: any): T { 
    return n as T; 
}

```

---

<div class="post-metadata">

### Author: ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)
#### Post date: [August 12, 2026, 5:42pm UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/93 "2026-08-12T17:42:03Z")

</div>

How exactly would a typeTo function be useful in blocks? I mean I’ll add it if you can give me an example I guess. I believe I already have a typeOf function but I’ll look.

---

<div class="post-metadata">

### Author: ![CodaKnight](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codaknight/32/33491_2.png) [@CodaKnight](https://forum.makecode.com/u/CodaKnight)
#### Post date: [August 12, 2026, 6:17pm UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/94 "2026-08-12T18:17:03Z")

</div>

Yes, I’m pretty sure he has typeof().

We need **Spread** lol. I’m pretty sure it’s not supported though.

---

<div class="post-metadata">

### Author: ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)
#### Post date: [August 12, 2026, 10:12pm UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/95 "2026-08-12T22:12:41Z")

</div>

![Screenshot 2026-08-12 at 2.28.45 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/b/4/b44fa916aa2f957bfe21a8c7167b0fb761759a73.png)  
☹

---

<div class="post-metadata">

### Author: ![TheEarth](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/theearth/32/34579_2.png) [@TheEarth](https://forum.makecode.com/u/TheEarth)
#### Post date: [August 12, 2026, 10:12pm UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/96 "2026-08-12T22:12:49Z")

</div>

? What’s that

---

<div class="post-metadata">

### Author: ![VoxelMaster64](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/voxelmaster64/32/32075_2.png) [@VoxelMaster64](https://forum.makecode.com/u/VoxelMaster64)
#### Post date: [August 12, 2026, 10:15pm UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/97 "2026-08-12T22:15:58Z")

</div>

So if you have an array like this: `let arr = [0, 25, "hello"]`, the type will be `(number | string)[]`. if you then do `if (arr[1] == 25)`, there would be an error (since `arr[1]` is a `number | string`). but doing `if (castTo<number>(arr[0]) == 25)` would work. I think in js you can also do ` arr[1] === 25` (that could be a `function typeEquals(a: any, b: any) { return a === b }`), but you still cant do `aStringVariable = arr[2]` even though arr[2] might be a string.

Maybe also, if possible, something that makes a variable’s type `any`? (basically `function toAny(a: any): any { return a }` but idk if that works)

---

<div class="post-metadata">

### Author: ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)
#### Post date: [August 12, 2026, 10:42pm UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/98 "2026-08-12T22:42:09Z")

</div>

Fair enough. I was not aware that you could make those types of arrays in blocks! They only work if you define them in the On Start, which generates code like this:  
 ![Screenshot 2026-08-12 at 6.34.20 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/e/c/ecdd3a68844d763cb8abf4ce883b3f2668efa882.png)  
If you define them in any other block it doesn’t work because it generates code like this:

 ![Screenshot 2026-08-12 at 6.33.47 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/8/d/8d4e147959adeb9c3c8aa4294f453a58043e0746.png)  
But sure I’ll add the block! I’m gonna need to do a lot more organization of my blocks because I think I’m gonna start putting them in new tabs, so the next release is gonna take a while.

---

<div class="post-metadata">

### Author: ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)
#### Post date: [August 12, 2026, 10:45pm UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/99 "2026-08-12T22:45:32Z")

</div>

Basically a special array functionality that can be used to easily insert one array into another array.

```auto
let array1 = [1, 2, 3]
let array2 = [9, …array1, 8]
// Now array2 = [9, 1, 2, 3, 8]

```

[Previous page](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766.md?page=4)
