0

I have this function inside a function, how i call fullName function?

var person = function(){
 
  function fullName(){}
}

person.fullName(); This doesn't work
corsaro
  • 731
  • 1
  • 9
  • 24
  • 3
    You cannot call it from outside the function. It's scope (visibility) is limited to the function body only. – connexo Dec 08 '22 at 09:01
  • 1
    Variables (including ones defined with function declarations) do not become object properties (except global ones in which case they might be added to `window` (*sigh*)). The `fullName` variable is not available outside the `person` function. – Quentin Dec 08 '22 at 09:04

0 Answers0