JavaScript - Object definition available before code execution on Safari
Objects and functions which I require only to execute once on a page load are wrapped inside an undefined check for the object. On Chrome on Windows/Linux which I usually use, the code works perfectly i.e. code only executes once. But on Safari on both iPad and MacBook, the undefined check doesn't work i.e. as per the browser, the object/function is already declared without even the code execution reaching there! I've simplified my code to only include an if loop that checks if the nested function is already declared. Since it should not have been declared the first time, I've included