I have saved a JSON file in my local system and created a JavaScript file in order to read the JSON file and print data out. Here is the JSON file:
{"resource":"A","literals":["B","C","D"]}
Let’s say this is the path of the JSON file: /Users/Documents/workspace/test.json
.
Could anyone please help me write a simple piece of code to read the JSON file and print the data in JavaScript?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…