Skip to content

Tag: javascript

Change Array[3] for every item in other array

EDIT Made a mistake in my question. The let tempArr = splitArr is wrong. This needs to be: tempArr = car. So the awnser of @Prime and @sabbir.alam does the trick! I have a array of values where one value (car[3]) of the array is a string seperated by “, “. I created a new array of those elements (…

How to escape double and single quotes in a JSON array

I’m trying to create a chat system where every time someone sends a message it gets added to the JSON array in my database for that specific person, but the issue I’m coming across is when anyone tries to use double quotes ” ” or a single quote ‘ in their message. Anytime a messa…