public function map(callable $callback) : Collection
    {
        $result = array_map($callback, array_keys($this->_data), $this->_data);

        return new static($result);
    }
public function map(callable $callback) : Collection
    {
        $result = array_map($callback, array_keys($this->_data), $this->_data);

        return new static($result);
    }
public function map ( callable $ callback ) : Collection { $ result = array_map ( $ callback , array_keys ( $ this -> _data ) , $ this -> _data ) ; return new static ( $ result ) ; }
Maps the array and returns a new object of this class.

Example:

```php
$arr = new \Alexya\Tools\Collection([
"test",
"foo",
"bar",
"tests"
]);

$newArr = $arr->map(function($key, $value) {
$value = strtoupper($value);

return $value;
});
// $newArr = new \Alexya\Tools\Collection([
//     "TEST",
//     "FOO",
//     "BAR",
//     "TESTS"
// ]);
```

@param callable $callback Callback to apply to the array.

@return Collection Mapped array.
Maps the array and returns a new object of this class .