# 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:** 20
**Page:** 2

<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: [October 13, 2025, 3:13am UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/21 "2025-10-13T03:13:38Z")

</div>

Not being able to set the start value in blocks _is_ kinda annoying, I will admit…  
Though I will say, I agree that technically I can’t implement full For loop use in blocks, as the initialization, incrimination, and main body can all technically have any code you want in them. The check area can just be a Boolean input though, which works fine. And yeah, technically people could just use a While loop, but what’s the fun in that?!?

---

<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: [October 13, 2025, 3:20am UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/22 "2025-10-13T03:20:44Z")

</div>

I like teaching students how to express a counter-driven `for()` loop as a `while()` loop to show an example of how a `while()` loop is supposed to be written:

- Determine your control variable.
- Initialize the control variable before entering the loop.
- Use the control variable in the conditional expression.
- Alter the value of the control variable within the loop.

---

<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: [November 11, 2025, 7:06pm UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/23 "2025-11-11T19:06:47Z")

</div>

I have added a block that people can use to make their own fonts, without having to paste them into the javaScript. **THIS DOES NOT WORK WITH FANCY TEXT FONTS!** It is meant to make my [Makecode Font Editor](https://forum.makecode.com/t/makecode-font-editor/36236) easier to use for block users.

 ![Screenshot 2025-11-11 at 12.06.54 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/c/9/c9560ed6e9e302fb258584f97e3bc05532849534.png)  
@AlexK I forgot about this, but I’ll look into the For loop. I don’t know how I will be able to increment the variable the user provides like the actual For block can do. I’ll need to find the code for that block and copy it.

---

<div class="post-metadata">

### Author: ![Iro](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/iro/32/34749_2.png) [@Iro](https://forum.makecode.com/u/Iro)
#### Post date: [November 11, 2025, 8:13pm UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/24 "2025-11-11T20:13:11Z")

</div>

I know this isn’t arcade, but could you make an extension that adds metadata blocks to the Makecode for Microbit editor?

---

<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: [November 11, 2025, 10:20pm UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/25 "2025-11-11T22:20:10Z")

</div>

What exactly do you mean by metadata?

---

<div class="post-metadata">

### Author: ![Iro](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/iro/32/34749_2.png) [@Iro](https://forum.makecode.com/u/Iro)
#### Post date: [November 12, 2025, 1:00am UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/26 "2025-11-12T01:00:06Z")

</div>

Like, changing the name of a variable by a variable. kind like this:

 ![Screenshot 2025-11-11 5.06.27 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/0/d/0d1d1d68b274e75610ee13bb27cc8148dea08b9b.png)

(the first bubble is the name, and you are able to put another variable into it to actively change it.)

---

<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: [November 12, 2025, 4:19am UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/27 "2025-11-12T04:19:47Z")

</div>

I suppose I could make something like that. What exactly do you need it for? I mean, at a certain point you must realize that blocks have limits that JavaScript simply doesn’t have and at least try to learn it instead of creating a new extension for it…  
Uhh anyways, yeah, what is the use for this exactly? (I can almost guarantee that you can achieve this effect using arrays instead…)

---

<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: [November 13, 2025, 6:49pm UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/28 "2025-11-13T18:49:37Z")

</div>

@richard  
1)  
I found a bug with the expandable block variable inputs. Before you expand a block using the “+”, there is a drop point in the top left corner of the block (obviously [0, 0] relative to the block because the drop point has not yet been fully defined) where you can drop in variables, which appear again when you expand the block:

 ![Screenshot 2025-11-13 at 12.26.51 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/2/7/2711c9d88b5b54749896b5ff1c494a965ea1b556.png)  
 ![Screenshot 2025-11-13 at 12.30.39 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/3/3/333ad6e4e68695a98c236c715831923e8b6396c4.png)

2)

 ![Screenshot 2025-11-13 at 12.12.00 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/0/1/01f6e008d69d7d6fad12a7d7ed4895f4efdf8d13.png)  
I found this bug while trying to implement a For loop with a minimum and step inputs. I’m wondering if it’s possible to replicate the normal block For loop, with the ability to drop your own variables into that “index” area and have them work correctly.  
My current code:  
 ![Screenshot 2025-11-13 at 12.12.25 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/f/8/f8d13d09740c25fd5094bf89f10edd15f0233bd7.png)

---

<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: [November 13, 2025, 10:44pm UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/29 "2025-11-13T22:44:10Z")

</div>

Also, is there any way to get something like this to work?

 ![Screenshot 2025-11-13 at 4.30.23 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/b/a/baad5c28f8c533b676592deb6be39b90262c922e.png)

---

<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: [November 14, 2025, 12:12am UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/30 "2025-11-14T00:12:20Z")

</div>

Ok I figured out that the actual For block in makecode is essentially coded as its own thing an is not built using normal block syntax, which is unfortunate. Same with the IF block. So I won’t really be able to make that functionality unless Richard has some secret knowledge to share with me.

---

<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: [November 14, 2025, 9:37pm UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/31 "2025-11-14T21:37:41Z")

</div>

This seems to work:

```typescript
    //% block="for $index from $start to $stop skip $inc"
    //% handlerStatement
    //% start.defl=1 stop.defl=10 inc.defl=1
    //% draggableParameters="reporter"
    //% hidden
    export function test(
        start: number,
        stop: number,
        inc: number,
        body: (index: number) => void
    ) {
        for (
            let counter: number = start;
            counter <= stop;
            counter += inc
        ) {
            body(counter)
        }
    }

```

> **[Inline Function Block Test](https://arcade.makecode.com/57867-29156-71991-73300)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

Feel free to shine it up however you like.

---

<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: [November 14, 2025, 10:21pm UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/32 "2025-11-14T22:21:57Z")

</div>

The functionality I was trying to recreate was this ability of the For loop to change the variable inside:

 ![Screenshot 2025-11-14 at 5.05.42 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/f/5/f5dfc60256dae45e6cfcc9b92d5ecb8da0ddf08e.png)  
Otherwise, my code does the same thing yours does. I just wanted it to be perfect, though it seems that is not possible, so I’ll push my current code to gitHub now!

I am curious what that “//% hidden” does. I didn’t see anything change when I removed it.

---

<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: [November 14, 2025, 10:24pm UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/33 "2025-11-14T22:24:51Z")

</div>

@richard I’ve been encountering a few issues with the project list on the home page not showing the projects it should.  
This is my home screen:

 ![Screenshot 2025-11-14 at 5.17.36 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/c/5/c51f84f75d23561a7c93b1288c9c871f8a736012.png)  
But this is the actual list of projects when I click on “View All”:  
 ![Screenshot 2025-11-14 at 5.17.50 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/3/b/3b8d57d01099712d16254646ab278dee39fc0716.png)  
That “Asteroids and Laser Beams” project is the 9th project in that list, but is the 3rd project on my home screen (sorry for bad screenshots that don’t really show what I’m talking about)

Also, two of those “pxt-javascript-extras” projects are actually named “pxt-javascript-extras - Copy” when I open them. I did find it interesting that those copies also let me push to the same gitHub repo, which is neat.

---

<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: [November 14, 2025, 10:30pm UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/34 "2025-11-14T22:30:45Z")

</div>

Ah. Yeah … changing the control value inside of a `for()` loop is … not recommended. 😃 Although, you’re right… You can manipulate the control variable in Blocks. Interesting. I wonder if TypeScript likes variables by reference. 😆

 ![arcade-screenshot](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/d/e/de8ab09c87fb4eb33a1d6f386bab32f5fd0e004b.png)

`//% hidden` prevents the code snippet from appearing in the toolbox when switching to a typing language. TypeScript and Python have their own ways to handle `for()` loops; no need to clutter the toolbox with redundant snippets.

---

<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: [November 14, 2025, 10:40pm UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/35 "2025-11-14T22:40:39Z")

</div>

Ah, I suppose literally every block in my extension should be hidden then, but also if you were using javaScript you wouldn’t need my extension at all. I’ll do that to them all when I have the time I suppose.

@AlexK approves posts so fast that I could actually do an “Edit: thanks for the like, @AlexK” thing every time if I were a more annoying person.

---

<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: [November 17, 2025, 6:43pm UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/36 "2025-11-17T18:43:16Z")

</div>

@richard another bug just now. I was editing the Json file because I was checking to make sure I had added the “shader”: “\*” line to it. When I switched back to the extension file, this happened:

 ![Screenshot 2025-11-17 at 10.00.47 AM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/c/e/ce89b1d3f66a127b158d960742900767b9d64a72.png)  
Then I went to restore it using the history and pressing the restore button just did nothing the first time, then it worked the second time but I got the classic “project had a conflict, changes stored in “… - Copy” screen. Going back to the projects list screen and neither copy has the " - Copy” title:  
 ![Screenshot 2025-11-17 at 10.05.40 AM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/5/6/56ff300533c153951bbd268572d4f379dd43946a.png)  
When I open that first one, it has the " - Copy"  
 ![Screenshot 2025-11-17 at 10.09.36 AM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/c/5/c5cf4d66454ed90a357f4c002b9b84e50d2a8dd6.png)  
And still only one of them shows up in the normal projects view:  
 ![Screenshot 2025-11-17 at 10.12.24 AM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/4/7/47b90eb9295326fc071f610dd871aec2c00bfdb2.png)  
Obviously I could always just restore from the GitHub version if something when terribly wrong, so I’m not super worried. I’m once again bug reporting here because I’m too lazy to make a proper report on GitHub.

---

<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: [November 17, 2025, 6:54pm UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/37 "2025-11-17T18:54:32Z")

</div>

Ok, I’ve added the new shader implementation to the extension. By the time this is approved, I should have a new release created! Here is an example project for the new shader blocks:

> **[pxt-javascript-extras - Copy](https://arcade.makecode.com/S59613-44143-12427-37578)**
>
> Shader test project

> **Old version**
>
> [https://arcade.makecode.com/S25291-92884-02261-24481](https://arcade.makecode.com/S25291-92884-02261-24481)

Will I be explaining how these work in the future? Ehhhhhh… probably…? I’m thinking of making some tutorial/explainer type posts in the future, so probably. In the meantime, if someone asks directly, I will most certainly explain!

As usual, if you have any issues at all, let me know!

@Richard I’ve been having many “project was edited in multiple places and the changes conflict!” pop ups while using this extension in blocks. Could there be an issue with my function → block conversion code or maybe with super large extensions? Idk. It could just be crappy school internet.

---

<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: [November 18, 2025, 3:32am UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/38 "2025-11-18T03:32:19Z")

</div>

oooh fun new update

---

<div class="post-metadata">

### Author: ![Luke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/luke/32/32519_2.png) [@Luke](https://forum.makecode.com/u/Luke)
#### Post date: [November 18, 2025, 5:50pm UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/39 "2025-11-18T17:50:12Z")

</div>

Will the update break all the old blocks?

---

<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: [November 18, 2025, 9:01pm UTC](https://forum.makecode.com/t/making-an-extension-for-every-javascript-exclusive-feature-i-can-think-of/36766/40 "2025-11-18T21:01:00Z")

</div>

I don’t _think_ the update should break anything but I didn’t have time to test that! (I don’t have any old projects that use it to test on, so I’ll have to use someone’s forum game)  
That’s the main thing I haven’t tested yet. If you have an old project, make a copy, update it in the _copy_ and if anything goes wrong please let me know!

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

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