I am in the process of learning node. The following code is giving me inconsistent result ie, if i give argv1.indexOf('test'), then the code is unable to find the text, but, some time it is returning true. Why is it so.
function process(argv1) {
if(argv1.indexOf('test')) {
console.log('Text is available in array.');
}
}
process(['test','one','help', 'one', 'two']);
indexOfto return in this case?indexOf?