Global variables on client side script

I want to declaire some variables on client side, how can I do t hat?


frappe.ui.form.on('Sales Order', {

const status = {
    EXTERNA: 'Externa',
let externa = status.EXTERNA;

refresh: function (frm) {


You can declare variables in the sales_order.js file and use it appropriately

 frappe.ui.form.on('Sales Order','onload', function(frm, cdt, cdn) {
     var payment_value=0;

Refer this link for further information Developer Cheatsheet · frappe/frappe Wiki · GitHub

I hope you find this useful.