![javascript](https://habrastorage.org/r/w120/webt/59/cc/76/59cc7600c78a2239379574.jpeg)
JavaScript
- 1 ответ
- 0 вопросов
0
Вклад в тег
function arrayToList(array) {
if (array.length > 1) {
return { value: array.shift(), rest: arrayToList(array) };
} else {
return { value: array.shift(), rest: null };
}
}