How to import javascript function in portal js

How to import javascript function in portal js

for example frappe.set_route is not function not working in portal js

Please see this -

Thank you,it is working
I was checking it is possible or not to import function