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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:52:03+00:00 2026-06-12T14:52:03+00:00

I wrote such object literal in TypeScript: var object = { message: Say, say:

  • 0

I wrote such object literal in TypeScript:

var object = {
    message: "Say",
    say: () => {
        return this.message;
     }
};

And I got such generated JavaScript:

var object = {
    message: "Say",
    say: function () {
        return _this.message;
    }
};

Shouldn’t there be such line before return statement:

 var _that = this;

as I am using arrow function expression?

  • 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-12T14:52:05+00:00Added an answer on June 12, 2026 at 2:52 pm

    You’re correct. It’s missing the :

    var _this = this;
    

    This is discovered after the release(0.8) and is currently fixed on the developer branch.

    Note:
    Also I think you wanted to write

    var object = {
        message: "Say",
        say: function () {
            return () => this.message;
        }
    };
    

    which will actualy print Say when it’s run.
    See: http://wiki.ecmascript.org/doku.php?id=harmony:arrow_function_syntax

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

Sidebar

Related Questions

I wrote this function to communicate with an external program. Such program takes input
I wrote a shared object, say libsd.so , and I put libsd.so and its
Apologies for asking such a primitive question. I wrote a function which took one
I've got a usercontrol that I wrote for an XNA based tile editor. This
I wrote such a property (representing direction for my XNA game object): public Vector2
When i wrote the following, i get such warning, and it doesn't match anything,
How can I write this in such a way that $counter value is 1
I have a DataContext object, called CodeLookupAccessDataContext, that was generated through the Visual Studio
I've always been dabbling in javascript, but never really got hugely into writing a
how do you clone a dictionary such as this one : Dictionary<int, List<User>>() Every

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.