Home › Forums › JavaScript › Store JSON data in a variable › Reply To: Store JSON data in a variable
November 21, 2014 at 9:20 am
#188908
__
Participant
Most likely reason is to make the data easy to maintain — e.g., adding or removing questions is easier if they are organized in a simple format, separately from the actual application code. (To clarify, note that, strictly speaking, the questions and answers aren’t “code”: they’re data.)
Reading about “separation of concerns” might be helpful as well. It might be difficult to see the advantage with such a small project, but it certainly is a habit worth developing.