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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:31:48+00:00 2026-06-02T16:31:48+00:00

according to MDN , when using the unary plus operator: Integers in both decimal

  • 0

according to MDN, when using the unary plus operator:

Integers in both decimal and hexadecimal (“0x”-prefixed) formats are
supported. Negative numbers are supported (though not for hex). If it
cannot parse a particular value, it will evaluate to NaN.

But when I run this Jasmine test (the toBe() matcher applies a === operator):

   it("should return NaN when trying to convert a string representing a NEGATIVE HEX to the corresponding number", function() {
    var a = '-0xFF';        
    expect(typeof +a).toBe('number');
    expect(isNaN(+a)).toBeTruthy(); //Fails on Chrome and Opera...
  });

It fails on Chrome and Opera (and passes in IE, Safari and Firefox).

Is it a flaw in Chrome and Opera’s engines or am I missing something?

  • 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-06-02T16:31:49+00:00Added an answer on June 2, 2026 at 4:31 pm

    It may – or may not be seen as a flaw, depending on how one’s attached to specifications. )

    I’ve found an interesting discussion regarding this behavior. Looks like Firefox was for once in the ‘better-than-spec’ camp, but then fixed it according to spec.

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

Sidebar

Related Questions

According to the documentation i would like to overwrite predefined formats using this settings:
According to MDN documentation for JSON.stringify : Properties of non-array objects are not guaranteed
According to the MDN JS Doc , the charAt method takes in an integer
According to the String.prototype.replace() page on MDN , I should be able to easily
According to the site, http://www.dba-oracle.com/t_nls_lang.htm Problem might occur even if both the database and
According documentation: System.Array.Sort<T> - sorts the elements in an entire System.Array using the System.IComparable
According to the Java standard the short and char types both use 2 bytes
So according to MDN (it makes sense) the AnimationEvent has the bubble argument but
I need help with this two elements properties. According MDN element.scrollHeight this a height
According to the gcc docs , memcmp is not an intrinsic function of GCC.

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.