In markdown, you can add a language modifier after the triple backticks (e.g. ```json
) to get syntax highlighting.
To get syntax highlighting In Google Docs, you can:
```json
{ "hello": "world" }
```
Syntax highlighting can help make the code more readable, especially when it's in the context of a document full of other kinds of text. It can also help identify problems with examples and code snippets.
~ https://developer.mozilla.org/en-US/docs/MDN/Contribute/Editor/Syntax_highlighting