Cast JSValue to Integer?

I might be overlooking the obvious here, but 
How do I cast a JSValue back to an Integer?

Did you try


var
  i: integer;
begin
  i := integer(JSValue);
end;