-3

I am unable to understand a small code piece of JavaScript. Please help me to know the meaning of the following JavaScript blocks:

x = 2 + a / 30 >> 0;

What is the meaning of ">>" in JavaScript?

D = !0;

What is the value of D?

Gábor Lipták
  • 9,646
  • 2
  • 59
  • 113
Guru G Gulab
  • 23
  • 1
  • 8

1 Answers1

2

Not only JavaScript it is Shift operator generic to almost all programming languages..

Here is a link:

Example: 5 << 1 becomes 10..

(0101)b becomes (1010)b .. ie, 10 in decimal system

Enthusiastic
  • 549
  • 4
  • 8
  • 23