Trough template manager
In joomla you can use
For your convenience you can use file name yjsg_custom_params.php to add any custom files or code blocks.
This file is located in site_root/template/yjsg_template_name/custom/ folder.
var myVar = 'myValue';
Just add following line to yjsg_custom_params.php file.
$yjsg_js.="var myVar ='my_js_var;'";
Warning:don't forget the dot before the = operator.