Skip to content
Advertisement

How to store input values from user in json format?

I used below code to store student information but I get only one value appearing in the json file.

JavaScript

Advertisement

Answer

It is because you are overwriting your file after each while loop. Do the writing to file outside. Also, You want to store student into list.

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement