2012 May 15, 3:30
Built-in
-
map
-
input | %{ expression($_) }
-
forEach
-
input | %{ [void]expression($_) }
-
filter
-
input | ?{ expression($_) }
-
indexOf
-
input.indexOf(value)
Close to built-in
-
some
-
if (input | ?{ expression($_) }) { ... }
-
every
-
if (-not input | ?{ !expression($_) }) { ... }
-
lastIndexOf
-
[array]::lastIndexOf(input, value)
Write it yourself
-
reduce
-
function reduce($fn, $a, $init) { $s = $init; $a | %{ $s = &$fn $s $_; }; $s; }
javascript powershell array technical