mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-02 12:19:11 +00:00
New utility method
Surprising that this seems to be the recommended approach
This commit is contained in:
parent
4e9dd3123b
commit
0d175d3eeb
@ -12,6 +12,15 @@ Various static utility functions.
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Return the number of keys in an object
|
||||
*/
|
||||
exports.count = function(object) {
|
||||
var s = 0;
|
||||
$tw.utils.each(object,function() {s++;});
|
||||
return s;
|
||||
};
|
||||
|
||||
/*
|
||||
Push entries onto an array, removing them first if they already exist in the array
|
||||
array: array to modify
|
||||
|
Loading…
Reference in New Issue
Block a user