sortArr = finalArray.sort((a, b) => typeof a.indexStart === "number" && typeof b.indexStart === "number" && a.indexStart - b.indexStart);
TS2345: Argument of type '(a: ISecureWord, b: ISecureWord) => number | false' is not assignable to parameter of type '(a: ISecureWord, b: ISecureWord) => number'. Type 'number | false' is not assignable to type 'number'. Type 'boolean' is not assignable to type 'number'.
в том что ты вопрос в песочницу не залил https://www.typescriptlang.org/play
https://www.typescriptlang.org/play?#code/KYDwDg9gTgLgBASwHY2FAZgQwMbDgSQGVhsBXKYAdWgBM4BvAKDjgHdaAuOAZximQDmAbmZwYATzDAuvfkmGjMAisBpcARhAgAbYJiQiWNYKmyoaAfhl9BhxEmMhCMTLCtwkpALbq0d5I4Aog7unj5+jAC+jIzYEEi8cK5QcAC8cADaoixMLHl5AEQINAVcAMwALAA02flwBRJSpfVImF7ABTV1hQGgzq4wzQCM1bX5RQ6gwSVcAEyj3SwFSiozYlCkwF2LBcam5s0F3Nj8YIPb3QXsUGsFALIIANZ4hPo04gW1kRcMYz1rZQArD9xo0OlxdphUAB5dAAIQQsAAFp0-ktek4XLBmrMgSCepMQNMcRVgWj6itgKpmnxNvilnsSAcIcdTudyVdaIchgAGAB0vIFAE4RZ98t9arkdsVmmUAGz0+pgw7cbgAOW8vigqMW9Qx-WxXAqI0VEyCDmaFVmAA5TZTqVxaVsOYyzA76qyEGcdTtrrchrNARVrUGAOwh0nhsV5CX5KWXGXlUOm5UQ1rtH0JwkGwZcIYi00Y4lzHllO3KKlrJ2m13M+pxJDYBBoAQdU1+w4AKX0HS+jAAujEG4luNAYABBKBQLhEEjkKi0DL9tJJKd80ewAAUtU3mCqcHUAEo0gA+MSSYAQdBJPn6rHwVKPuAAcjCWufcAAZJ-z1Irwfb2ze80ifV9NTQD9vxvO8BjgABaACYNgbZDxEIA
Обсуждают сегодня