0

I have this in java:

int minimo = Integer.MAX_VALUE;

how would it look in javascript? Is there an equivalent of n"integer" in javascript?

var minimo = Integer.MAX_VALUE;

?

dertkw
  • 7,798
  • 5
  • 37
  • 45
Lekasp
  • 93
  • 2
  • 13

1 Answers1

2

JavaScript has only one number type Number. It automatically switches between floats and integers as needed.

Use Number.MAX_SAFE_INTEGER to get the max integer value and Number.MAX_VALUE to get the max float value.

For me these are 9007199254740991 and 1.7976931348623157e+308

Halcyon
  • 57,230
  • 10
  • 89
  • 128