How to get view mode of a node? So my question is how I can get programmatically in preprocess node hook, the display mode of a node, for example, to check if view mode is a teaser or full?
The view mode is in the vars:

function MYMODULE_preprocess_node(&amp;$vars) {
    $view_mode = $vars['view_mode'];
}


See template_preprocess_node() or node.html.twig for more info.