This can be useful for few things:
- computer programmers can store code snippets as notes with syntax highlighting
- JSON, XML etc. can be used as storage for structured data (typically used in conjunction with scripting)
Trilium supports syntax highlighting for many languages, but by default displays only some of them (to reduce number of items). You can add extra languages in Options -> Code notes (available since Trilium 0.35).
Alternative to the code note is a "code block" - feature of a text note which can add short snippets of code to the text editor. The disadvantage is that code blocks don't support syntax highlighting.