Hello i am doing Symmetric Difference and was thniking to use JSON.stringify on Arguments and then replace it with regEx but it didn’t work i am wondering why ?
var newArr= JSON.stringify(arguments); // "{'0':[1,2,3],'1':[5,2,1,4]}"
newArr= newArr.replace(/'[\d]\'/g,""); //it didn't delete the keys then i have another
newArr= newArr.replace(/[{}:\[\]]/g, ""); //this one worked
//and then i wanted to use filter or somethink iwoul chainit
I used another approach but i still wondering why it didn’t worked?
Sry but i’m not asking what is best but i asking why it doesn’t work with replace ? the keys with “”?
or why it is wrong in general what artefacts it can generat