aboutsummaryrefslogtreecommitdiff
path: root/js/lib
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib')
-rw-r--r--js/lib/elgglib.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/js/lib/elgglib.js b/js/lib/elgglib.js
index dc1f8f60c..a8ab2020c 100644
--- a/js/lib/elgglib.js
+++ b/js/lib/elgglib.js
@@ -69,6 +69,17 @@ elgg.isString = function(val) {
};
/**
+ * Check if the value is a number
+ *
+ * @param {*} val
+ *
+ * @return boolean
+ */
+elgg.isNumber = function(val) {
+ return typeof val === 'number';
+};
+
+/**
* Check if the value is an object
*
* @note This returns true for functions and arrays! If you want to return true only