When I'm trying to compare a string with an input from process.stdin.on , I'm getting false always.
//Imagine user inputting 'hello' always.
process.stdin.on('data', userInput => {
let text = userInput.toString();
if(text == 'hello'){
console.log("True");
}
if(text === 'hello'){
console.log("True");
}
process.exit();
});
If I check typeof userInput it shows string. If i log userInput it shows exact the same as my string.
so, why these conditions are false?