I'm trying to reason with this code, I know this is probably fairly obvious but I'm jr.dev 😝 so I have no idea.
in material-ui-filter/src/store/selectors.js line 46-55
var sortOrder = sortOrientation ? 1 : -1
return (x, y) => {
var a = getValue(x, sortField, getSourceValue)
var b = getValue(y, sortField, getSourceValue)
var result = a < b ? -1 : a > b ? 1 : 0
return result * sortOrder
}
}
the x, y doesn't reference anything in scope,
it's an anonymous function, providing undefined values... I Think. Shouldn't it always be undefined then? I've console.log() to try and peek inside but I still don't get it.
I'm trying to reason with this code, I know this is probably fairly obvious but I'm jr.dev 😝 so I have no idea.
in
material-ui-filter/src/store/selectors.jsline 46-55the
x, ydoesn't reference anything in scope,it's an anonymous function, providing undefined values... I Think. Shouldn't it always be undefined then? I've
console.log()to try and peek inside but I still don't get it.