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

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b32b4f-2be3e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b32b4f-2be3e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?