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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:05:16+00:00 2026-05-25T23:05:16+00:00

I have seen jquery-ui-1.8.11.js verify console.log functionality by doing if (this.debug) console.log() I have

  • 0

I have seen jquery-ui-1.8.11.js verify console.log functionality by doing

if (this.debug)
   console.log()

I have also seen people define an anonymous function that is a no-op for browsers with no console logging like IE7.

if(typeof console === "undefined") {
    console = { log: function() { } };
}

Is there a technical difference or are both functionally equivalent?

  • 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-05-25T23:05:17+00:00Added an answer on May 25, 2026 at 11:05 pm

    Both of those do something else. The first code suppresses logging messages unless a flag is set. The people who develop jQuery UI need logging when working on it, and turn it on. But people using the library don’t want to have their console cluttered by log messages from libraries, so it’s off by default. It lets you turn off logging even when the browser supports it – that regular users on IE7 don’t get script errors is a (possibly intended) side effect.

    The second code defines a dummy console.log(), so you can call the method without checking if it exists everywhere. It will not suppress logging on browsers where it’s supported.

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

Sidebar

Related Questions

I have seen this (I'm also using it): $(document).ready(function(){ // do jQuery }) and
I have seen a lot of articles on this, but none dealing with jQuery,
I have seen this post here: jQuery UI autocomplete with item and id but
In jQuery, I have seen both the following ways of defining a jQuery function:
I'm not sure if I have seen this right but using the jQuery UI
I have seen the jquery documents, stackoverflow and other forums, but this doesn't seem
I have seen the following script from jQuery Validation Plugin. http://docs.jquery.com/Plugins/Validation/Methods/email email: function(value, element)
I have seen many people asking this question and have tried it all (such
i have seen some hand rolled solutions but does jquery out of the box
I have seen slideUp and slideDown in jQuery. What about functions/ways for sliding 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.