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 at: 2023/05/18 08:41; Updated at: 2023/05/19 07:07