Wondering if there is a way to combine identical code of 2 separate functions into 1 function.
In my case:
jQuery(\'body\').on(\'click\', \'.some_div
You can define a single function which you call under both events:
function doSomething(e) {
console.log('Your code here...');
}
jQuery('body').on('click', '.some_div', doSomething);
jQuery(window).resize(doSomething);
Bear in mind that the reference to this will be different depending on the event raised, should that be used within your doSomething function.