summaryrefslogtreecommitdiff
path: root/program/js/common.js
diff options
context:
space:
mode:
Diffstat (limited to 'program/js/common.js')
-rw-r--r--program/js/common.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/program/js/common.js b/program/js/common.js
index b532c36c1..ee38c3528 100644
--- a/program/js/common.js
+++ b/program/js/common.js
@@ -607,8 +607,8 @@ if (!String.prototype.startsWith) {
}
// array utility function
-Array.prototype.last = function() {
- return this[this.length-1];
+jQuery.last = function(arr) {
+ return arr && arr.length ? arr[arr.length-1] : undefined;
}
// jQuery plugin to emulate HTML5 placeholder attributes on input elements