I have a list with both numbers and strings in there.
Each element of the list looks something like:
{
'name': 'Bob',
'number': 234234
}
But, either name or number may be missing.
In my sortBy I did something like this:
_.sortBy(list, function(element) {
if (element.name) {
return element.name;
}
else {
return element.number;
}
});
This sorts the elements with numbers in front of the elements without it. How do I get lodash to deprioritize numbers?