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,698
  • 5
  • 37
  • 44

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
  • 56,029
  • 10
  • 87
  • 125