# What's the difference?

**URL:** <https://forum.makecode.com/t/whats-the-difference/47611>\
**Category:** Global MakeCode Arcade Game Jam\
**Tags:** graphics-and-math\
**Created:** [November 28, 2026, 8:20pm UTC](https://forum.makecode.com/t/whats-the-difference/47611 "2026-11-28T20:20:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheGooberEarth](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thegooberearth/32/36693_2.png) [@TheGooberEarth](https://forum.makecode.com/u/TheGooberEarth)\
**Post date:** [November 28, 2026, 8:20pm UTC](https://forum.makecode.com/t/whats-the-difference/47611/1 "2026-11-28T20:20:05Z")

</div>

I recently learned about string conversion via `${}` but in MakeCode there is also the function “.toString”. What is the difference other than some template stuff? Next question uhh is one of them faster than the other(I don’t understand the inner working of MKCD) so it might be they are as fast as each other or smth.

---

<div class="post-metadata">

**Author:** ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)\
**Post date:** [November 29, 2026, 9:36pm UTC](https://forum.makecode.com/t/whats-the-difference/47611/2 "2026-11-29T21:36:43Z")

</div>

well I know that in pure JavaScript ${} Grabs a Variable in a string like “Hi ${Name}” so it puts Name in there well to string just converts say a number to a string aka 0 becomes “0”

---

<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 29, 2026, 9:37pm UTC](https://forum.makecode.com/t/whats-the-difference/47611/3 "2026-11-29T21:37:51Z")

</div>

The difference is really just template stuff. I have personally never really used ${} strings, but I can see how they might make some code simpler and neater.

I did a pretty simple test and it seems that toString() is marginally faster. This test does have issues, but I tried to make it somewhat realistic to how you would use the 2 options differently in your code by adding the commas to the string. Even with the toString() method needing 2 “+” bits to add the commas, instead of only 1 for the ${} string, toString() still won, averaging ~215 vs ${} which averaged ~250. These are marginal speed improvements either way, so **it probably doesn’t matter unless you’re using it hundreds of times every frame.**

 ![Screenshot 2026-11-29 at 12.45.35 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/f/2/f20a6b1541c70e46af4dcfe61f409b7337521b3a.png)  
I did do more than just this test and toString() came out on top pretty much every time.

---

<div class="post-metadata">

**Author:** ![TheGooberEarth](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thegooberearth/32/36693_2.png) [@TheGooberEarth](https://forum.makecode.com/u/TheGooberEarth)\
**Post date:** [November 30, 2026, 1:59am UTC](https://forum.makecode.com/t/whats-the-difference/47611/4 "2026-11-30T01:59:53Z")

</div>

ahh cool(time to give you a solution)

---

<div class="post-metadata">

**Author:** ![Hulahoop](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/hulahoop/32/37375_2.png) [@Hulahoop](https://forum.makecode.com/u/Hulahoop)\
**Post date:** [November 30, 2026, 2:22am UTC](https://forum.makecode.com/t/whats-the-difference/47611/5 "2026-11-30T02:22:13Z")

</div>

Ooooh. So that’s what a solution looks 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 30, 2026, 2:22am UTC](https://forum.makecode.com/t/whats-the-difference/47611/6 "2026-11-30T02:22:20Z")

</div>

Did you make this with the #Arcade > Global MakeCode Arcade Game Jam tag just so you could use the “solution” button? 😏
