Spot the bug in the duplicate check

from Algorithmic complexity
Node 24 beginner 4 min 1 issue to find

Find the complexity bug in this duplicate check.

JavaScript
function hasDuplicate(orderIds) {
  const seen = [];
  for (const orderId of orderIds) {
    if (seen.includes(orderId)) {
      return true;
    }
    seen.push(orderId);
  }
  return false;
}
Open in playground
Report an error