src/modules/misc/utils.js
// replaces similar values by spreadArray and shifts all the old values with higher indicies to the corresponding spot, it then returns the new array
replaces similar values by spreadArray and shifts all the old values with higher indicies to the corresponding spot, it then returns the new array
replaces similar values by spreadArray and shifts all the old values with higher indicies to the corresponding spot it then returns the new array
function replaceAndSpreadIntoArray(value, spreadArray, inputArray) {
    let newArray = []
    for (let i = 0; i < inputArray.length; i++) {
        if (inputArray[i] === value) newArray.push(...spreadArray);
        else newArray.push(inputArray[i]);
    }
    return newArray;
}
function replaceAndSpreadIntoArray ( value , spreadArray , inputArray ) { let newArray = [ ] for ( let i = 0 ; i < inputArray . length ; i ++ ) { if ( inputArray [ i ] === value ) newArray . push ( ... spreadArray ) ; else newArray . push ( inputArray [ i ] ) ; } return newArray ; }
replaces similar values by spreadArray and shifts all the old values with higher indicies to the corresponding spot, it then returns the new array
replaces similar values by spreadArray and shifts all the old values with higher indicies to the corresponding spot it then returns the new array