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 8092425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:16:51+00:00 2026-06-05T20:16:51+00:00

I am learning Javascript and I have read functions are first class objects and

  • 0

I am learning Javascript and I have read functions are first class objects and most authors mention that functions can return functions (which are objects) and pass them as parameters to other functions.

I am sure there is a lot more to it so what are the differences between functions in C# and functions in javascript?

In C# am I right to say functions are not objects (don’t have methods, properties etc) even though with closures (with lambda expressions and delegates) they seem to behave like function objects as in javascript?

I feel that with lambda expressions in C# the distinction becomes a bit blurry for someone just coming to the language.

  • 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-06-05T20:16:52+00:00Added an answer on June 5, 2026 at 8:16 pm

    The one biggest difference I can think of is that in C# functions, variables are lexically scoped, whereas Javascript, variables are lexically scoped except for this, which is dynamically scoped.

    For example, in Javascript, you can say something like

    var foo = new Object();
    foo.x = 0;
    var bar = function() { this.x = 2; };  // first-class function... what's "this"?
    foo.baz = bar;   // Now foo has a method called 'baz', which is 'bar'.
    foo.baz();
    alert(foo.x);   // Displays 2 -- 'this' magically refers to 'foo'!
    

    Try writing this in C#.

    Or actually, don’t bother — it will not make any sense.

    Why? Because this doesn’t refer to anything here, lexically! Its meaning changes dynamically, unlike in C#, where its meaning simply depends on the enclosing class, not who the caller actually is.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm learning javascript. I know we can pass a function to other functions after
Learning Javascript and have a question about global variables. From my reading, most recommend
I have a simple request(still learning javascript). I have a title div and 3
I have looked on Google, and everywhere in the forums. Just learning JavaScript, so
I am making a small calculator (just for JavaScript learning) and I have two
I have been learning the Definitive Guide of JavaScript.i got a question about the
I have just started learning Jquery and am new to writing javascript (I am
I like javascript, but I have problem with learning it :) I mean, i
I'm learning jQuery/javascript and have a rather basic question. Why doesn't this work? Thanks
I have just started learning Javascript. I want Hello World! to be written to

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.