I receive a file path string like so:
let sampletext="Home/Student/Hello.txt";
And I want to convert this into the following structure dynamically. How should I best go about this?
let idarray=[
{
'id':'Home',
'parent': '',
},
{
'id':'Student',
'parent': 'Home',
},
{
'id':'Hello.txt',
'parent': 'Student',
}
]