Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7277953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:48:36+00:00 2026-05-28T22:48:36+00:00

Since functions are first class objects, it should be possible to assign to the

  • 0

Since functions are first class objects, it should be possible to assign to the members of them.

Am I right thinking that arguments.callee does this?

Are there any other ways to set these fields?

How is it possible to set field in first case?

function something1() {
    arguments.callee.field = 12;
} 

alert(something1.field); // will show undefined
something1();
alert(something1.filed); // will show 12

something2 = function() {
    arguments.callee.field = 12;
};

alert(something2.field); // will show undefined
something2();
alert(something2.field); // will show 12

UPDATE 1

I mean how to access members from within function when it runs.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T22:48:36+00:00Added an answer on May 28, 2026 at 10:48 pm

    You don’t need to use arguments.callee to refer to a function that has a name; you can just use the name. This is naturally the case when you declare the function using the

    function name(...) { ... }
    

    syntax; but even in a function expression, you’re allowed to supply a temporary name:

    (function temp_name(...) { ... })(arg);
    

    So, if you want to set the properties from inside the function, you can write:

    function something1() {
        something1.field = 12;
    } 
    
    alert(something1.field); // will show undefined
    something1();
    alert(something1.field); // will show 12
    
    something2 = function something2() { // note the second "something2"
        something2.field = 12;
    };
    
    alert(something2.field); // will show undefined
    something2();
    alert(something2.field); // will show 12
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Since functions are values in Python, how do I determine if the variable is
Since I started studying object-oriented programming, I frequently read articles/blogs saying functions are better,
Since the function template in the following code is a member of a class
When I took my first programming course in university, we were taught that global
There is a static class Pipe, defined in C++ header that I'm including. The
I have a class with a property that can be an Image (i.e. an
I'm new to C++, this is my first week since the upgrade from fortran.
For the past few days I've been writing classes that at first I thought
I am writing unit tests for objects that are cloned, serialized, and/or written to
First of all, I apologize for yet another interface question. I thought that this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.