Print node title in custom block module twig file I want to send node title and description into twig file. See my code

public function build() {

return [
'#theme' =&gt; 'block--maincontentlatestnews',
'#latest_news' =&gt; $this-&gt;read_latest_news(),
'#sample' =&gt; 'sample_txt',
'#attributes' =&gt; [],
];
}

function read_latest_news(){

$nids = \Drupal::entityQuery('node')-&gt;condition('type','article')-&gt;execute();
$nodes = entity_load_multiple('node', $nids);

return $nodes ;

}
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);