Can someone assist me with a problem I'm facing while learning NativeScript? I am trying to read a txt file that contains JSON data and then assign it to an Array called countries. However, despite my efforts, I have not been successful.
The code snippet I am using is:
public countries: Array
console.log(response)
console.log(JSON.parse(JSON.stringify(response)))
Here is the output I am getting:
[ { "name": "Afghanistan", "code": "AF" }, { "name": "Albania", "code": "AL" } ]
If anyone could provide some guidance on how to solve this issue, I would greatly appreciate it. Thank you,