1

I have been making input fields of type number on the client side. I've been giving them a max attribute of the maximum integer value in the client's browser, using:

Number.MAX_SAFE_INTEGER.toString()

Now, I'm outputting an input field on the server-side. I still want the maximum value of the field to be the client's maximum integer.

How do I get the client's max int size from the server, without passing it?

Hutch Moore
  • 124
  • 1
  • 12

1 Answers1

1

Number.MAX_SAFE_INTEGER is a static, constant variable. It is always 253 - 1 = 9007199254740991.

Not sure why you would want to fetch that dynamically ever.

Andrius
  • 5,934
  • 20
  • 28