mode() public method

Get the mode of a given key.
public mode ( null $key = null ) : array
$key null
return array
 public function testWithMultipleModeValues()
 {
     $collection = new Collection([1, 2, 2, 1]);
     $this->assertEquals([1, 2], $collection->mode());
 }