Flake
Flake

Reputation: 1406

setting a property of function javascript

Whenever I write

console

I can't seem to find the prop property , when I try to view func in console.

Where does the prop property go and How does the property setting work?

Upvotes: 0

Views: 33

Answers (2)

Oriol
Oriol

Reputation: 288000

IMO the following is is more intuitive than console.dir:

  1. Open Firefox instead of Chrome
  2. Run that code in Firefox's web console
  3. Click the returned function
  4. The object inspect subpanel will show the properties.

Upvotes: 0

Ramanlfc
Ramanlfc

Reputation: 8354

prop is being defined on the func function reference.

To access the property use func.prop or do console.dir(func) will show the property in the property tree

Upvotes: 1

Related Questions