0

Does changing a JSON file with JS acutally affect the JSON file or does it only change the JSON file in temp memory?

Code

user.properties[0].firstName = "Jane";

This is from Replacing a property value in JSON.

Edit

I am not using a server to develop my website, but will be using one when I post it.

1
  • 3
    Unless you're writing the object back to disk it only affects the copy stored in memory Commented Jan 21, 2018 at 18:30

1 Answer 1

2

That would only affect the json in memory, you would then need to write the changes back to the filesystem for it to update the file contents.

Sign up to request clarification or add additional context in comments.

12 Comments

How would I do that?
Post the changes back to the server and use whatever server side language you running to write the contents.
What if I am not using a server to design my website?
How are you hosting it then ? What is you dev setup?
I am hosting it on a local server.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.