Forum Discussion
TestQA1
2 years agoFrequent Contributor
What if I write my own logic and don't use Compare methods.
I tried a below code but the loop seems to be running more than the indexes/lines I have in the first file and the values at index shows single character.
function CompareFiles() {
var firstFile = "abc.txt";
var secFile = "aac.txt";
for(let i =0; i<firstFile.length;i++) {
if(firstFile[i] !== secFile[i])
return true;
else {
return false;
}
}
}
Related Content
Recent Discussions
- 23 minutes agoGill