lodash/underscore 通过数组值中的键查找对象

lodash/underscore find objects by key that is in values of array

我有这个对象数组:

[
    {
        id: 1,
        name: 'test 1'
    },
    {
        id: 2,
        name: 'test 2'
    },
    {
        id: 3,
        name: 'test 3'
    },
    {
        id: 4,
        name: 'test 4'
    }
]

我有这个 ID 数组:

[1, 3]

如何select IDs 数组中存在 id 属性 的所有对象?

var ids = [1, 3];
var found = _.where(items, function (item) {
    return ids.indexOf(item.id) !== -1;
});