Я пытаюсь создать оператор if, который должен сравнивать две строки, но по той же причине что-то не работает.
console.log(this.selectedDay.split("/")[2])
console.log(this.selectedMonth)
if( this.selectedMonth !== this.selectedDay.split("/")[2]) {
console.log("The strings are different")
} else {
console.log("The strings are the same")
}
[РЕДАКТИРОВАТЬ], когда я вручную сравниваю два значения, результат правильный
if( 'נובמבר 2018' !== 'נובמבר 2018') {
console.log("The strings are different")
} else {
console.log("The strings are the same")
}

[EDIT2]
Назначение результата разделенияв VAR
const value1 = this.selectedMonth;
const value2 = this.selectedDay.split("/")[2];
console.log(value1)
console.log(value2)
if( value1 !== value2) {
console.log("The strings are different")
} else {
console.log("The strings are the same")
}
})

[Edit3]
Я преобразовал всю строку в массив, как предложил пользователь @ConnorsFan, иэто то, что подошло.Сумасшедший ..
const value1 = this.selectedMonth;
const value2 = this.selectedDay.split("/")[2];
console.log(value1);
console.log(value2);
console.log(value1.split(""));
console.log(value2.split(""));
if( value1.valueOf() === value2.valueOf()) {
console.log("The strings are the same")
} else {
console.log("The strings are diffrent")
}
})
