• Solution fails

Question related to mission Replace First

 

Don't understand why this solution fails:

function replaceFirst(values: number[]): number[] {
    if (values.length) {
        values.push(values.shift(0))
    }

    return values;
}
6