aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-09 00:44:35 +0000
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-09 00:44:35 +0000
commit932eacfba30061f3abc31bc4d328d27dcad7efca (patch)
treed4ce22bc08725a407bba9e04fd028aec15d3f074 /js
parent1c96a5471db09748dd8a622a8a65c9df58a45dbb (diff)
downloadelgg-932eacfba30061f3abc31bc4d328d27dcad7efca.tar.gz
elgg-932eacfba30061f3abc31bc4d328d27dcad7efca.tar.bz2
Added elgg.isNumber type-checking function
git-svn-id: http://code.elgg.org/elgg/trunk@7260 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'js')
-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