Answer the question
In order to leave comments, you need to log in
How to convert such a nested object?
Hello.
I have this nested object:
[
{
ID: 1,
NAME: 'Телефоны и гаджеты',
CHILDREN: [
{
ID: 2,
NAME: 'Смартфоны',
CHILDREN: [
{
ID: 2,
NAME: 'Смартфоны iPhone'
}
]
}
]
}
]
{
id: 1,
name: 'Телефоны и гаджеты',
children: {
id: 2,
name: 'Смартфоны',
children: {
id: 2,
name: 'Смартфоны iPhone'
}
}
}
Answer the question
In order to leave comments, you need to log in
For example, using recursion - https://codesandbox.io/s/pensive-kapitsa-lthws?fil...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question