arr.sort(({ date: a }, { date: b }) => !a ? 1 : !b ? -1 : a - b);
// или
arr.sort((a, b) => (a.date || Infinity) - (b.date || Infinity));
const sortedArr = arr
.map(n => [ n, n.hasOwnProperty('date') ? n.date : Infinity ])
.sort((a, b) => a[1] - b[1])
.map(n => n[0]);
if(!$('.login-form')[0].checkValidity()) {
$('.login-form__submit').off( "click" ).click().click(function (e) {
e.preventDefault();
tryToLogin();
});
return false;
}