DEV Community

sakethk
sakethk

Posted on

4 1

In javascript 0 * -1 = -0 !

Do you know when we evaluate this 0 * -1 in javascript we will get -0 because javascript can hold positive 0 (+0) and negative 0 (-0).

Why +0 and -0 ?

Because the sign (+ and -) will represent the axis or direction.

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs