Can anybody help me.
I am trying to sort strings from array
var someArray= ["3a445a_V1", "3", "2a33s454_V1", "1", "3_V2", "2s4a34s3_V2", "234343"];
const [record] = someArray.map(r => parseFloat(r.replace('_V','.'))).sort((a,b) => a < b);
console.log(record)
//it returns 3a445a.1
In browser console.log it works fine, not in typescript?
typescript it is giving below error Error:
error TS2345: Argument of type '(a: number, b: number) => boolean' is not
assignable to parameter of type '(a: number, b: number) => number'.
Type 'boolean' is not assignable to type 'number'.
Any idea? thanks in advance
(a,b) => a < bis not a valid comparison function. As typescript says, it's supposed to return a number, not a boolean.