# JavaScript errors on Perlin Noise code

**URL:** https://forum.makecode.com/t/javascript-errors-on-perlin-noise-code/19091
**Category:** Help
**Tags:** javascript
**Created:** [April 10, 2023, 6:01pm UTC](https://forum.makecode.com/t/javascript-errors-on-perlin-noise-code/19091 "2023-04-10T18:01:04Z")
**Posts on this page:** 3
**Page:** 1

<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: [April 10, 2023, 6:01pm UTC](https://forum.makecode.com/t/javascript-errors-on-perlin-noise-code/19091/1 "2023-04-10T18:01:04Z")

</div>

So, i am not that good at JavaScript code. But i couldnt find any perlin noise codes in python so i found one in JavaScript. Though, i needed to fix some errors that come from importing code from the outside world to the makecode editor, most of them were an easy fix except for these last ones. This isn’t a rush it is just something i am tinkering with.

The only errors there are is 2 “Decleration or Statement excpected”

Here is the code:

> **[Perlin Noise](https://arcade.makecode.com/S02875-92957-08249-88122)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

### Author: ![EpicKitty](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/epickitty/32/8358_2.png) [@EpicKitty](https://forum.makecode.com/u/EpicKitty)
#### Post date: [April 10, 2023, 6:27pm UTC](https://forum.makecode.com/t/javascript-errors-on-perlin-noise-code/19091/2 "2023-04-10T18:27:37Z")

</div>

Seems like the code for Perlin noise is for Javascript and not Typescript, MakeCode Arcade uses TypeScript instead of JavaScript but still mentions it as Javascript. Not sure why this error is happening but you can try using [a Python implementation of Perlin noise](https://gist.github.com/eevee/26f547457522755cb1fb8739d0ea89a1) or [a game made with a TypeScript implementation of Perlin noise](https://arcade.makecode.com/#pub:94402-93728-60346-73496) by [yoxd707](https://forum.makecode.com/u/yoxd707) (It’s in perlinNoise.ts)

---

<div class="post-metadata">

### Author: ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)
#### Post date: [April 12, 2023, 10:54pm UTC](https://forum.makecode.com/t/javascript-errors-on-perlin-noise-code/19091/3 "2023-04-12T22:54:12Z")

</div>

Using `this` is unsupported outside of a method. You’re using it in a function call, which is not implemented.

> **[MakeCode Languages: Blocks, Static TypeScript and Static Python](https://makecode.com/language)**
>
> MakeCode programs can be authored in Blocks, Static TypeScript or Static Python.

Under ‘_Unsupported language features_’:

> - `interface` with same name as a `class`
> - casts of a non-`class` type to a `class`
> - `interface` that extends a a `class`
> - inheriting from a built-in type
> - **`this` used outside of a method**
> - function overloading
