This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { expect } = require('chai'); | |
/** | |
* Flattens nested arrays | |
* @param {Array} array The array to flatten. | |
* @returns {Array} Returns the new flattened array. | |
*/ | |
const flatten = (arr: Array<any>): Array<number> => arr.toString().split(',').map(x => parseInt(x, 10)).filter(x => !!x) || []; | |
describe('flatten', () => { |