The code converts the string "DataList[2]" to a JSON object and replaces the "errMessages" field with "errors". The resulting JSON object is then parsed to produce the following new JSON object:
{ "errors": "There was an error processing the data.
Library: react
var s = JSON.stringify(DataList[2]);
var t = s.replace(/"errMessages"/g, '"errors"');
var newJson = JSON.parse(t);