mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-12-09 18:28:07 +00:00
Added zero based zth[] operator and documentation (#6150)
This commit is contained in:
@@ -103,4 +103,16 @@ exports.nth = function(source,operator,options) {
|
||||
return results.slice(count - 1,count);
|
||||
};
|
||||
|
||||
/*
|
||||
The zero based nth member of the list
|
||||
*/
|
||||
exports.zth = function(source,operator,options) {
|
||||
var count = $tw.utils.getInt(operator.operand,0),
|
||||
results = [];
|
||||
source(function(tiddler,title) {
|
||||
results.push(title);
|
||||
});
|
||||
return results.slice(count,count + 1);
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user