Write me a javascript function that takes a number as a parameter and returns it in reverse.
system
mujhe ek javascript fnction likhen jo ek sankhya ko ek parameter ke rup main letaa he or ise reverse main lautaata he.
user
beshak, neeche ek fnction he jo ek purnank ko ek parameter ke rup main letaa he or ise reverse main lautaata he.

fnction reverse (x) {
  const adhiktam = math.pow (2, 31) - 1;
  const min = -math.pow (2, 31);

  let res = 0;

  jabaki (x! == 0) {
    res = res * 10 + (x % 10);
    x = parseint (x / 10);

    if (res> adhiktam || res <minute) {
      ritern 0;
    }
  }

  ritern res;
}
assistant
<|system|>
</s>
<|user|>
mujhe ek javascript fnction likhen jo ek sankhya ko ek parameter ke rup main letaa he or ise reverse main lautaata he.</s>
<|assistant|>
beshak, neeche ek fnction he jo ek purnank ko ek parameter ke rup main letaa he or ise reverse main lautaata he.

fnction reverse (x) {
  const adhiktam = math.pow (2, 31) - 1;
  const min = -math.pow (2, 31);

  let res = 0;

  jabaki (x! == 0) {
    res = res * 10 + (x % 10);
    x = parseint (x / 10);

    if (res> adhiktam || res <minute) {
      ritern 0;
    }
  }

  ritern res;
}</s>
