src/Map.php
public function first($expression, $n = 1)
    {
        if (is_numeric($n) && intval($n) <= 0) {
            throw new \InvalidArgumentException('Argument $n must be whole number');
        }
        return $this->grep($expression, intval($n));
    }
public function first($expression, $n = 1)
    {
        if (is_numeric($n) && intval($n) <= 0) {
            throw new \InvalidArgumentException('Argument $n must be whole number');
        }
        return $this->grep($expression, intval($n));
    }
public function first ( $ expression , $ n = 1 ) { if ( is_numeric ( $ n ) && intval ( $ n ) <= 0 ) { throw new \ InvalidArgumentException ( 'Argument $n must be whole number' ) ; } return $ this -> grep ( $ expression , intval ( $ n ) ) ; }
Return a new map containing the first N elements passing the
expression.

Like `find`, but stop after finding N elements from the front. Defaults
to N = 1.

```
$nums = new Map(range(0, 9));
$odd3 = $nums->first('1 == ($_0 % 2)', 3); // first three odds
```

@param callable|string $expression
@param int $n
@return new static
@api
Return a new map containing the first N elements passing the expression .