How to output express variables to js in jade template

A question in the learning process that cannot be answered in the official jade/pug documentation.
variables defined in express routing are passed to the corresponding jade template and output to html is normal, but how to output the values in variables directly to script js in jade?

for example, define a variable test,
clipboard.png

test
clipboard.png


you can refer to the script of the jade template to get the json variable from the background

.
Menu