How do I view and extract data inside a variable, populated from another piece of code, that may contain hidden escape characters or data in Javascript (JQuery stuff is fine too)?
For example lets say I have an Ajax call such as this, where data is printed from a back-end script written in Lua:
success: function(data)
{
dataItems = data.split(",");
}
Lets say I'm expecting a four letter string in each of the dataItems array. If I use Chrome or Firefox putting a breakpoint on dataItems I see each array containing a four letter string and I'm happy because it looks right and I can now process it. However if I do a print(dataItems[1].length) for example I notice it has a length of 5, and my debugger shows dataItems[1]="abcd", obviously there is something hidden inside it that doesn't show easily as part of the arrays variable. Is there a better way to catch and view these hidden pieces of information preferably in a browser debugger? How does one go about removing this undesired data once it is recognized.