logo

CuriousTab

CuriousTab

Discussion


Home Interview Technology Comments

  • Question
  • How JavaScript timers work? What is a drawback of JavaScript timers?


  • Correct Answer
  • Timers allow you to execute code at a set time or repeatedly using an interval This is accomplished with the setTimeout, setInterval, and clearInterval functions The setTimeout(function, delay) function initiates a timer that calls a specific function after the delay; it returns an id value that can be used to access it later The setInterval(function, delay) function is similar to the setTimeout function except that it executes repeatedly on the delay and only stops when cancelled The clearInterval(id) function is used to stop a timer Timers can be tricky to use since they operate within a single thread, thus events queue up waiting to execute 


  • Technology problems


    Search Results


    • 1. Are javascript and jQuery different?
    • Discuss
    • 2. Does javascript have the concept level scope?
    • Discuss
    • 3. How do you create a new object in JavaScript?
    • Discuss
    • 4. What is the difference between an alert box and a confirmation box?
    • Discuss
    • 5. How to determine the state of a checkbox using Javascript?
    • Discuss
    • 6. What is Javascript namespacing? How and where is it used?
    • Discuss
    • 7. What are the different objects used in JavaScripts?
    • Discuss
    • 8. What does window.history object?
    • Discuss
    • 9. Which of the following is added to prefs.js,when open a dialog box each time an error occurs?

    • Options
    • A. user_pref("javascript.classic.error_alerts", true);
    • B. user_pref("javascript.classic.error_alerts ", false);
    • C. user_pref("javascript.console.open_on_error ", false);
    • D. user_pref("javascript.console.open_on_error ", true);
    • Discuss
    • 10. Which of the following navigator object properties is the same in both Netscape and IE?

    • Options
    • A. navigator.appCodeName
    • B. navigator.appName
    • C. navigator.appVersion
    • D. None of the above
    • Discuss


    Comments

    There are no comments.

Enter a new Comment