How can I print a variable in the node template? How can I print a variable in the node template?

For example, if it's a variable of content, we can print it with the following code.

{{ content.field_name }}


If I have a {{ counter }} variable, how do I display it with Twig?
If it's a variable that came from a hook_preprocess_node, you can just print it in your twig template as you wrote it in your example:

{{ variable_name }}