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

  • Home
  • SEARCH
  • 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 8700675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:13:19+00:00 2026-06-13T02:13:19+00:00

I have declared an object with variables and methods. Here it is simplified var

  • 0

I have declared an object with variables and methods.
Here it is simplified

var myObj = {
    myTimer: null,
    startTimer: function(){
        clearTimeout(myObj.myTimer);
        myObj.myTimer = setTimeout("myObj.myFunction()", 250);
    },
    myFunction: function(){
        alert('Hi');
    }
};

After startTimer is invoked, the following errors is printed to the console

Uncaught ReferenceError: myFunction is not defined
Uncaught ReferenceError: startTimer is not defined

How can i solve this?

  • 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-13T02:13:21+00:00Added an answer on June 13, 2026 at 2:13 am

    There was actually nothing wrong with my code, although it could probably be more pretty.

    The problem was how i was calling the methods, and not within the object itself.

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

Sidebar

Related Questions

I have two methods declared public void MethodA(object o, Action<string> action) { } public
I have declared a class variable in here void downloader_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e) {
I have declared three variables namely TemplateData tData; TaskInstance tInstance;int tID; in my program.
I have the following method which returns the local declared Object by value: Human
Do variables declared in methods get erased after the method call is done? Ie
I have declared a helper function to a method of a class I declared
I have learned that in a class you can declare variables and methods. They
I have objects with many variables that I declare and explain in the comments.
I have declared a variable like this @{ int i = 1; } Now,
I have declared std::priority_queue like this. priority_queue < Aircraft, vector<Aircraft>, less<Aircraft> > *q; And

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.