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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:04:24+00:00 2026-05-30T13:04:24+00:00

Using the javascript library underscore.js (v.1.3.1), I’ve reproduced the following on the mac in

  • 0

Using the javascript library underscore.js (v.1.3.1), I’ve reproduced the following on the mac in up-to-date Chrome (17.0.963.56) and in Firefox 7.0:

0 === -1 * 0
> true

_.isEqual(0, -1 * 0)
> false

This is surprising, at least to me. I expected that two values for which === is true would result in _.isEqual also being true.

What’s going on here? Thanks!

  • 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-30T13:04:26+00:00Added an answer on May 30, 2026 at 1:04 pm

    It has been put explicitly in the source:

    function eq(a, b, stack) {
      // Identical objects are equal. `0 === -0`, but they aren't identical.
      // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal.
      if (a === b) return a !== 0 || 1 / a == 1 / b;
    

    In fact, JavaScript does interpret 0 and -0 differently, but you usually don’t see this because 0 == -0 and 0 === -0. There are only a few ways to check for the difference.

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

Sidebar

Related Questions

i am using jsGantt javascript library for showing gantt charts in html . now
I am trying to create a sortable image matrix, 5x5 using scriptaculous javascript library
I am using a charting javascript library that expects its data in a specific
I’m generating multiple, random sized, circular elements using the Raphael JavaScript library but because
I'm currently using the Yahoo YUI javascript library in a couple of my projects.
Without using any JavaScript library like JQuery, how do I show an error to
Is it possible to edit images using a javascript library and then send the
Im using the Prototype Javascript Library's Window class to create pop up windows in
I using JavaScript JSON library to parse JSON encoded array, received via POST. Here
I'm using a JavaScript library called phpjs The goal is to create functions that

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.