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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:53:30+00:00 2026-05-27T02:53:30+00:00

I need to distinguish 0 from 0 in Firebug console.log output. If you type

  • 0

I need to distinguish "0" from 0 in Firebug console.log output.

If you type console.log("0") into Firebug console, you’ll get 0, same as if you’d typed console.log(0), but I need it to be "0".

In other words, expected output:

console.log("0")
> "0"
console.log(0)
> 0

Actual:

console.log("0")
> 0
console.log(0)
> 0

What is the best solution to this problem?

I’ve found some workarounds like console.log("%o", "0") or console.log(["0"]), but they are too clumsy and obtrusive to use them everywhere.

I’ve also tried debug and info without success.

By the way, Chrome console gets it right, but I’m not ready to move to Chrome yet.

I’m thinking about writing some wrapper around console object. I’m not sure how to do it right but I’ll try it if there is no other solution.


So, the only solution seems to be that you need make some wrapper that looks like this (based on @wsanville’s answer):

var log_orig = console.log;
// No need to check for type, just use %o for everything
// Also, it gets messier for multiple arguments
console.log = function(s) { log_orig('%o', s); }

But then you get the problem with line numbers, as described in How to access line numbers when wrapping Firebug (or similar) Console api

I guess I should file a firebug bug or something, because this can be really critical in some situations.

  • 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-27T02:53:31+00:00Added an answer on May 27, 2026 at 2:53 am

    You could try using console.log(new String('0')) to distinguish from the two cases.

    You could also just clobber console.log and encapsulate whichever solution you like best, like this:

    var log_orig = console.log;
    console.log = function(s)
    {
        if (s === '0')
            log_orig('%o', s);
        else
            log_orig(s);
    }
    
    console.log('0'); //results in "0"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to distinguish between a Queens style address, from a valid ranged address,
In several places I have to retrieve some value from a dict, but need
Need to insert selected text on the page into textarea. There must be some
I'm getting more and more confused as I try to distinguish from the ambiguities
Need to distinguish between iPhone3x and iPhone4x . Is there any way to figure
How to distinguish the server version from the client version of Windows? Example: XP,
Say that you want to do some fancy formatting of some tabular output from
I need to use a type (any type) as a marker in an implicit
I need to handle 404 exceptions differently than all other types of them. What
I need to Distinguish Between Clicks and Double-Clicks and I have used this solution

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.