I have a little problem to solve. I want to compare two texts if they are the same.
let currentValue = "24960307.W 25880305.W 24880208.W 25650156.W"
let newValue = "24880208.W 24960307.W 25650156.W 25880305.W"
// is the same text just diferent order
// when i did includes
let x = currentValue.includes(value);
console.log(x);
//response in console
false
I tried with includes and localeCompare but still show that text is different.
valuein that code? I mean... you have to check each part of the two strings if order is not important and you're stuck with string representation. This isn't the same text, but may be the same value for your purposes.splitthe strings on, say, a space, and compare the arrays.