Getting a node's field value

Getting a node's field value in Drupal 8.

<?php
$node->get($fieldname)->getValue();
$node->$fieldname->getValue();
$node->$fieldname->value