XPath has the best map and filter syntax.
E.g. if you have a $list of numbers, you can multiple them all by two using $list ! (. * 2)
$list
$list ! (. * 2)
Or if you only filter the numbers greater than 50, you can write $list[. > 50].
$list[. > 50]
Or together, filter and map: $list[. > 50] ! (. * 2)
$list[. > 50] ! (. * 2)
It all works without explicitly declaring variables, functions or loops.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
XPath has the best map and filter syntax.
E.g. if you have a
$list
of numbers, you can multiple them all by two using$list ! (. * 2)
Or if you only filter the numbers greater than 50, you can write
$list[. > 50]
.Or together, filter and map:
$list[. > 50] ! (. * 2)
It all works without explicitly declaring variables, functions or loops.