Can some one explain me what can be use case of function’s name property in Javascript?, I read that it can be helpful in recursion, how ?
function foo() {}
foo.name; // "foo"
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.
a use case from MDN
You can use
obj.constructor.nameto check the “class” of an objectThink of it the as using
get_class()in PHP or.getClass().getName()in Java.