Answer the question
In order to leave comments, you need to log in
How to get data from JSON file?
I have a JSON file with data in my project folder. Based on this data, I need to build a table. I basically thought over the construction logic, but I don’t understand how to get data from a JSON file. Example:
JSON:
[
{
"id": "5c2286fb23e87be312d55d9a",
"name": {
"firstName": "Brooks",
"lastName": "Stone"
},
"phone": "+7 (843) 431-2190"
]
Answer the question
In order to leave comments, you need to log in
Local file? Install Node!
UPD
const array = JSON.parse(ваша_json_строка)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question