Print node title in custom block module twig file
return array_map(function($node) {
  return $node-&gt;label();
}, $nodes);


or if you want links:

return array_map(function($node) {
  return $node-&gt;toLink()-&gt;toString();
}, $nodes);