# How do I make a 2 dimensional array?

**URL:** <https://discourse.processing.org/t/how-do-i-make-a-2-dimensional-array/25934>\
**Category:** Coding Questions\
**Created:** [December 3, 2020, 3:56pm UTC](https://discourse.processing.org/t/how-do-i-make-a-2-dimensional-array/25934 "2020-12-03T15:56:16Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [December 3, 2020, 5:05pm UTC](https://discourse.processing.org/t/how-do-i-make-a-2-dimensional-array/25934/4 "2020-12-03T17:05:46Z")

</div>

> [@MisledWater079](#):
>
> Coding Challenge #11: 3D Terrain Generation with Perlin Noise

> **[3D Terrain Generation with Perlin Noise](https://thecodingtrain.com/challenges/11-3d-terrain-generation-with-perlin-noise/)**
>
> Let's fly to new heights with a 3D terrain coding challenge! Using Perlin Noise and beginShape() + endShape() with triangle strips, I'll guide you through visualizing a 3D procedural terrain in Processing.

> [@MisledWater079](#):
>
> … and he uses `float[][]` and it doesn’t work on p5.js…

```javascript
function createFloatArray2d(rows, cols) {
  return Array.from({ length: rows }, _ => new Float32Array(cols));
}

```

> **[Array.from() - JavaScript | MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from)**
>
> The Array.from() static method creates a new, shallow-copied Array instance from an iterable or array-like object.

> **[Float32Array - JavaScript | MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array)**
>
> The Float32Array typed array represents an array of 32-bit floating point numbers in the platform byte order. If control over byte order is needed, use DataView instead. The contents are initialized to 0. Once established, you can reference elements...

---

_[View the full topic](https://discourse.processing.org/t/how-do-i-make-a-2-dimensional-array/25934)._
