Here is a js object that represents the file system in the command line os project I'm working on:
var obj = {
"1": {
"hi": "hi"
},
"2": {
"bye": "bye"
}
};
var currentDir = obj["1"]["hi"];
console.log(currentDir);
When I run this, I get
"hi"
How do I get this to appear as
/1/hi/
I need to get the "file path" of the currently select object.
"hi"when I run it, not"[object Object]"."1"and"hi"manually, why can't you just do"1" + "/" + "hi" + "/"?console.log(firstIndex + '/' + secondIndex + '/ + obj[firstIndex][secondIndex]);