Not your usual array to string
npm i -S trend-array-to-string
import arrayToString from 'trend-array-to-string';
const array = [1, 3, 4, 5, 6, 7, 8];
arrayToString(array).then(res => console.log('res', res)); // 1,3-8
var arrayToString = require('trend-array-to-string').default;
var array = [1, 3, 4, 5, 6, 7, 8];
arrayToString(array).then(function (res) {
console.log('res', res); // 1,3-8
});
npm i
npm test