How to correctly define it !
You are welcome 
Hi,
Please make sure that you are running your JS code when all dependacy JS files are loaded and ready for use. For this you can use below handler and run your code once the core js code is loaded and available:
// On document ready
KTUtil.onDOMContentLoaded(function () {
// put your code here
});