So I have a short question: I'm reading data from a file, that works. I'm adding these data to a string, that's ok.
But when it comes to comparing these data on an if-statement it doesn't simply become true.
I've done console.log
of the string, and it appears correct:
["A", "B", "C", "D", "E"]
I've tried to rewrite the data, I've checked for syntax errors on the text file, but everything looks correct.
for (var i = 0; i < lineArray.length; i++) {
var singleLine= lineArray[i].split(' ');
console.log(singleLine) //And I get the array ["A", "B", "C", "D", "E"]
if (singleLine[4] === 'E') {
console.log("it works")
}
}
The thing I'm expecting to happen is to get the 'it works' on the console.