We're calling on all EU-based Mozillians with iOS or iPadOS devices to help us monitor Apple’s new browser choice screens. Join the effort to hold Big Tech to account!

This site will have limited functionality while we undergo maintenance to improve your experience. If an article doesn't solve your issue and you want to ask a question, we have our support community waiting to help you at @FirefoxSupport on Twitter and/r/firefox on Reddit.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

ఇంకా తెలుసుకోండి

toString method for a number returns 'undefined'

  • 1 ప్రత్యుత్తరం
  • 1 ఈ సమస్య కలిగినది
  • 4 వీక్షణలు
  • చివరి సమాధానమిచ్చినది jscher2000 - Support Volunteer

more options

The toString method for a Number object is returning the string 'undefined' (a string literal, not the undefined object) instead of the string representation of the number in question. This can be tested with a literal:

(5).toString();

Or with a variable:

var test = 5; test.toString();

And occurs in both in code running on a page, in the built-in JS console, and in Firebug, with Firefox versions 40.0.3 and 41.0. Expected result would be the string literal "5". (Which is exactly what I get with other browsers.)

This does not conform to the spec located here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString

Is this a known defect? If so, is there a recommended workaround?

UPDATE: Looks like this is specific to a particular site, so I presume the client has implemented something that overrides the toString method. Feel free to close and ignore this request.

The toString method for a Number object is returning the string 'undefined' (a string literal, not the undefined object) instead of the string representation of the number in question. This can be tested with a literal: (5).toString(); Or with a variable: var test = 5; test.toString(); And occurs in both in code running on a page, in the built-in JS console, and in Firebug, with Firefox versions 40.0.3 and 41.0. Expected result would be the string literal "5". (Which is exactly what I get with other browsers.) This does not conform to the spec located here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString Is this a known defect? If so, is there a recommended workaround? UPDATE: Looks like this is specific to a particular site, so I presume the client has implemented something that overrides the toString method. Feel free to close and ignore this request.

న netgecko99 చే మార్చబడినది

ప్రత్యుత్తరాలన్నీ (1)

more options

Testing in Firefox 41 on Windows, I see the expected result in the Web Console (Ctrl+Shift+k). Screen shot attached. ??