I have the following code:
for(i = 0; i < textArray.length; i++)
{
var reg = /\bSTEAM_[01]:[01]:[0-9]{1,10}\b/;
var correctID = textArray[i].match(reg);
if(correctID !== null)
{
var z = correctID.split(':');
var correctID64 = '765611' + 97960265728 + z[3];
steamIDs.push(correctID64);
alert(correctID64);
}
};
However, I get an uncaught type error: "Uncaught TypeError: Object [object Array] has no method 'split'" when I try to split correctID. To my understanding, correctID should be a string, and when I try to dump an index of correctID, it fails. However, when I dump the data type it comes back with [Object Array].
Why is correctID getting treated like an array? I'm assigning it a new value each time the loop runs, not adding values to an array.