0

This question is very similar to some I have read here, but I still haven't found an answer that would solve my problem.

I am creating a basic quiz in Javascript, and one of the tasks I was given is this (given to do as an exercise):

Store the quiz questions in an external JSON file.

I can go with local storage, but it is not saving it to a file. Can it be done in Javascript (without JQuery, without Node)?

mplungjan
  • 169,008
  • 28
  • 173
  • 236
Yozex
  • 73
  • 8
  • you will need to use node to store in a file JSON.stringify() is the function you need . – Ankur Jyoti Phukan Jul 30 '17 at 11:12
  • I know about JSON.stringify() and JSON.parse(), but I don`t know how to stringify it to a different local file. So, no way from pure Javascript? – Yozex Jul 30 '17 at 11:17
  • Might also consider cloud data storage – charlietfl Jul 30 '17 at 11:45
  • Are you sure the exercise isn't to read the quiz questions from a JSON file where they have been stored, as opposed to hard coding them in JavaScript? – traktor Jul 30 '17 at 12:24
  • It says "Store the quiz questions in an external JSON file". So, I guess I have to save(store) them to a different file, because they were already made in javascript. That is how I interpretated the exercise. – Yozex Jul 30 '17 at 12:48

0 Answers0