txt: ## nodemap.md
  nodemap
  
  Combined from primary sources listed below.
  
  # [In Any](#___top "go to top of document")[§](#(Any)_method_nodemap "direct link")
  
  See primary documentation
  [in context](/type/Any#method_nodemap)
  for **method nodemap**.
  
  ```raku
  method nodemap(&block --> List) is nodal
  ```
  
  `nodemap` will apply `&block` to each element and return a new [`List`](/type/List) with the return values of `&block`. In contrast to [deepmap](/routine/deepmap) it will **not** descend recursively into sublists if it finds elements which [do](/routine/does) the [`Iterable`](/type/Iterable) role.
  
  ```raku
  say [[1,2,3], [[4,5],6,7], 7].nodemap(*+1);
  # OUTPUT: «(4, 4, 8)␤»
  
  say [[2, 3], [4, [5, 6]]]».nodemap(*+1)
  # OUTPUT: «((3 4) (5 3))␤»
  ```
  
  The examples above would have produced the exact same results if we had used [map](/routine/map) instead of `nodemap`. The difference between the two lies in the fact that [map](/routine/map) flattens out [`Slip`](/type/Slip)s while `nodemap` doesn't.
  
  ```raku
  say [[2,3], [[4,5],6,7], 7].nodemap({.elems == 1 ?? $_ !! slip});
  # OUTPUT: «(() () 7)␤»
  say [[2,3], [[4,5],6,7], 7].map({.elems == 1 ?? $_ !! slip});
  # OUTPUT: «(7)␤»
  ```
  
  When applied to [`Associative`](/type/Associative)s, it will act on the values:
  
  ```raku
  { what => "is", this => "thing" }.nodemap( *.flip ).say;
  # OUTPUT: «{this => gniht, what => si}␤»
  ```
  