How would you check if the function that does exist and is defined, is empty or not? For example:
function foo(){
// empty
}
function bar(){
alert('something');
// not empty
}
Is there a function or a a simple way to check this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s not really very useful, and generally not a good idea, but you could do:
FIDDLE
If it’s just to check a callback, the normal way would be just to check if the callback is a function:
EDIT:
To also disregard comments :
FIDDLE