const checkItem = item => item.categoryid === '3';
const count = response.data.filter(checkItem).length;
// или
const count = response.data.reduce((acc, n) => acc + checkItem(n), 0);
// или
let count = 0;
for (const n of response.data) {
count += checkItem(n);
}
// или
const count = eval(response.data.map(checkItem).join('+')) || 0;