Skip to content
clare-lindleyPublic

About

Provides utility functions to transform data

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

datamorph

Provides utility functions to transform data.

This project is my learning sandbox and provided "as is" without warranty. It is NOT production code.

Installation

npm install

Testing

npm test

Usage

There is only one function at the moment!

To use the flattenArray function, include it in your JavaScript file:

import flattenArray from "./flatten-array.js";

Then, you can call the function with an array as an argument:

const flattened = flattenArray([1, 2, [3, 4, [5]]]);
console.log(flattened); // Output: [1, 2, 3, 4, 5]

Examples

console.log(flattenArray([1, 2, 3, [4, 5]])); // Output: [1, 2, 3, 4, 5]
console.log(flattenArray([1, [2, [3, 4]], 5])); // Output: [1, 2, 3, 4, 5]
console.log(flattenArray([])); // Output: []

About

Provides utility functions to transform data

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages