1

I am using Firebug for the first time and when I type

var a = 10;
console.log("value of a: " + a);

the response I get on the console is "undefined".

I suppose the syntax was correct, and I tried using it with alert and document. It worked fine, but Firebug isn't showing any output. How can I fix this?

Console screenshot

Note: I am talking about Firebug, the extension for Mozilla Firefox, not Firefox's built-in developer tools.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
SaurabhCooks
  • 179
  • 1
  • 9
  • The console log is returning the value just fine 'value of a: 10' – amyloula Oct 29 '17 at 10:42
  • Is it showing only undefined? "undefined" could be the return value of console.log (which is as expected). Can you post a screenshot? – Vasan Oct 29 '17 at 10:44
  • Mine is returning the value as "undefined". what could be the reason? – SaurabhCooks Oct 29 '17 at 10:44
  • @Vasan I have put up a screenshot. plz check. – SaurabhCooks Oct 29 '17 at 10:55
  • 3
    Please note that [Firebug is discontinued](https://hacks.mozilla.org/2017/10/saying-goodbye-to-firebug/) and stops working with Firefox 57. Therefore Firefox users are advised to use the [Firefox DevTools](https://developer.mozilla.org/en-US/docs/Tools) instead. – Sebastian Zartner Oct 30 '17 at 21:00
  • 1
    @SebastianZartner: Wow, Firefox's devtools look so similar to FireBug that I assumed the OP was using devtools, not actually using FireBug... – T.J. Crowder Nov 02 '17 at 12:12
  • 1
    They look similar when the Firebug theme is turned on, yes. That's intended to make the transition for Firebug users easier. Downside is that many people don't realize that they are actually using a different tool, because there is no obvious hint, and then wonder why "Firebug" behaves differently. – Sebastian Zartner Nov 02 '17 at 12:24
  • 1
    Strongly recommend not continuing to use a discontinued extension, esp. as the built-in devtools are at least as good and don't have this issue (whatever it is). – T.J. Crowder Nov 06 '17 at 15:20
  • Thanks everyone for helping me out! – SaurabhCooks Nov 06 '17 at 15:43
  • Possible duplicate: *[Chrome/Firefox console.log always appends a line saying 'undefined'](https://stackoverflow.com/questions/14633968)* – Peter Mortensen Oct 20 '20 at 18:32

1 Answers1

2

Separate expressions. Based on the screenshot, firefox displays the result of the first expression

David
  • 306
  • 4
  • 13