Light Mode
Dark Mode
error
function splitList(values) {
        if (values.length % 2 === 0){
            values = [values.slice(0, values.length / 2), values.slice(values.length / 2) ];
        }else{
            values = [values.slice(0, Math.floor(values.length / 2) + 1), values.slice(Math.floor(values.length / 2) + 1),];
        }
        return values; }

my answer is ok.

But Checkio say

node:assert:124 throw new AssertionError(obj); ^ AssertionError [ERR_ASSERTION]: Values have same structure but are not reference-equal: [ [ 1, 2, 3 ], [ 4, 5, 6 ] ] at /opt/project/test.ts:18:8

Please, tell me. Where is my error?

Created: May 18, 2023, 8:41 a.m.
Updated: May 19, 2023, 7:07 a.m.
0
9
User avatar
2957549