let say i have function like below
function doSomethingNow(){
callSomethingInFutureNotExistNow();
}
at the moment doSometingNow() is created callSomethingInFutureNotExistNow() not exist yet. It will be created in the future, on firefox, this doesn’t show any error on firebug. Will these kind of function compatible on all browsers without throwing errors ?
Since javascript isn’t compiled you shouldn’t ever receive any errors with the code you posted assuming you don’t call
doSomethingNow()beforecallSomethingInFutureNotExistNowis declared.To be safe though, you may want to do some null checking
Or if you want to be even more strict you can do type checking like this