edit-json-file
edit-json-file copied to clipboard
Use number as key
I'd like to use an ID as key.
messageFile.set("messages." + message.id + ".text", message.text);
But I'm getting a lot of null rows generated
The reason is that the tool thinks that I want to generate an array and fills up the empty rows with null.
Try escaping the id:
messageFile.set("messages.\\" + message.id + ".text", message.text);
Thank you for your response. Unfortunately I get the same result.
@IonicaBizau Any updates on this issue? I also got the same result with null data.
If message.id is a number, null is printed for message.id times.