Apply function for basic transformations?

I have been stuck for a while with this. I’m trying to use the apply function on a slice of Pages to get a slice of pages path. In other languages would be something like:

const pages = [new Page(1), new Page(2), ...] page => page.Path ) // returns ['path/to/1', 'path/to/2', ...]

I see that there is an apply function but didn’t find a way to use it like this since it’s not possible to create your own functions in Hugo.

Any insight? Thanks in advance!

You’re supposed to use built-in functions with it, as shown in the doc