const s1 = 'learn';
const s2 = 'today';
console.log(s1 === 'learn'); // true
console.log(s1 === s2); // false
employees.sort((a, b) => {
let fa = a.firstName.toLowerCase(),
fb = b.firstName.toLowerCase();
if (fa < fb) {
return -1;
}
if (fa > fb) {
return 1;
}
return 0;
});
Code language: JavaScript (javascript)