The isInt() method tests if the specified value is an integer, implying it can be parsed into an integer using the JavaScript parseInt() method.
status = Splunk.util.isInt( int )
|
int |
String, Integer |
Value to test for an integer. |
|
Boolean |
Value is integer indication: true = Value is an integer or can be converted to an integer. false = Value is not an integer. |
var int1 = 42;
var int2 = function() { return false; };
var int3 = '42';
var int4 = ['foo', 'bar'];
var int5 = { the_answer_to_life_the_universe_and_everything: 42}
alert(Splunk.util.isInt(int1));
alert(Splunk.util.isInt(int2));
alert(Splunk.util.isInt(int3));
alert(Splunk.util.isInt(int4));
alert(Splunk.util.isInt(int5));