I have a javascript object like this
var data = {
"person": {
"name": "John Doe",
"address": "N.Y City",
"city": "N.Y",
"country": "USA",
"phone": "Ph: 12345"
}
I want to print it like this: Person.Name----Person.Address----Person.Phone in a txt file. Until now I am able to do so with console.log like this
console.log(data['person']['name'] + "----" + data['person']['address'] + "----" + data['person']['phone'])
And the output in console is: "John Doe ---- N.Y City ---- Ph: 12345"
I don't want to print all the values of the json. I want to print some of these and also I want to have this between them "----".
Is it possible to print this in a txt file? I haven't fine anything yet.