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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:40:02+00:00 2026-06-10T17:40:02+00:00

My question is dead simple. I just casually discovered that once you have defined

  • 0

My question is dead simple.

I just casually discovered that once you have defined a property with this. into an object, you don’t need to prepend this. anymore when you want to call them.

So this. is really meant to be used ad definition time, like var?

I found it my self shortly after, i was referencing the window object with this. since i called my object without using new, so like it was a function.

One extra question, maybe for comments. Inside the main object, if i create a new object, and use this during the object definition, this this what will be referring to?

  • 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-10T17:40:03+00:00Added an answer on June 10, 2026 at 5:40 pm

    No, unless the context of this is a global object, such as window. Take the following example:

    function Foo(bar) {
        this.data = bar;
        console.log(this.data); // OK
        console.log(data); // ReferenceError
    }
    

    In this example, you’ll get a ReferenceError: data is not defined on the first console.log(data), unless, data is a global variable. To access the instance’s public member, you have to use this.data.

    References:

    • Understanding JavaScript’s this keyword
    • The this keyword
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry if this is a dead simple question but I'm confused from the documentation
Question in title pretty much sums it up. I have some resource object defined
I have a dead simple Common Lisp question: what is the idiomatic way of
I have a dead-simple question. How to use any SQLite library with nodejs under
greetings, i have a simple question. I have some page that i use for
another fun (and probably really simple) question for you, that I have half worked
I realize this is dead simple but I don't write many scripts so risking
A quick question in between: I have a simple WeakRunnableList. Is this way ok
Probably a dead simple and idiotic question (I'm totally new to javascript): I have
First of all, I apologize if this is a stupid question, I'm a dead

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.