How to display node title using computed field? I have a computed field (text) where I would like to display the node title. 

I tried the following thing but nothing worked.

$value = $entity-&gt;title;
$entity-&gt;title;


I referred  

1.
https://blogs.sulross.edu/lwetterauer/computed-fields/

2.
https://stackoverflow.com/questions/14087479/how-do-you-access-the-title-node-module-element-field-in-drupal-7
To get the value:

$value = $entity-&gt;title-&gt;value;