samuelmarina / is-even

Is a number even?
1.85k stars 193 forks source link

suggestion : use case insensitive comparison #196

Open divyanshu-kunwar opened 3 years ago

divyanshu-kunwar commented 3 years ago

🙄After watching your video My mind to me : should I delete this suggestion ?

Few suggestions

// function for a case insensitive comparision approach
function ciEquals(a, b) {
    return typeof a === 'string' && typeof b === 'string'
        ? a.localeCompare(b, undefined, { sensitivity: 'accent' }) === 0
        : a === b;
}
Nik-Sharp commented 2 years ago

Case-insensitive comparisons are too expensive for this program, the program must be as efficient as possible to suit enterprise customers.