Skip to content

Updated examples to es6 #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ By default simplex-noise.js will use Math.random() to seed the noise.
```javascript
// initializing a new simplex instance
// do this only once as it is relatively expensive
var simplex = new SimplexNoise(),
const simplex = new SimplexNoise(),
value2d = simplex.noise2D(x, y),
value3d = simplex.noise3D(x, y, z),
value4d = simplex.noise4D(x, y, z, w);
Expand All @@ -24,7 +24,7 @@ var simplex = new SimplexNoise(),
You can also pass in a seed string which will then be used to initialize
the noise using the built in alea PRNG.
```javascript
var simplex = new SimplexNoise('seed'),
const simplex = new SimplexNoise('seed'),
value2d = simplex.noise2D(x, y),
sameSeed = new SimplexNoise('seed'),
differentSeed = new SimplexNoise('different seed');
Expand All @@ -38,7 +38,7 @@ used to build the permutation table.
This can be used with a custom pseudo random number generator:

```javascript
var random = new Alea(seed),
const random = new Alea(seed),
simplex = new SimplexNoise(random),
value2d = simplex.noise2D(x, y);
```
Expand All @@ -50,7 +50,7 @@ The ALEA PRNG can be found on in the npm package [alea](https://npmjs.org/packag
Node.js is also supported, you can install the package using [npm](https://npmjs.org/package/simplex-noise).

```javascript
var SimplexNoise = require('simplex-noise'),
const SimplexNoise = require('simplex-noise'),
simplex = new SimplexNoise(Math.random),
value2d = simplex.noise2D(x, y);
```
Expand Down