This commit is contained in:
2021-10-06 22:13:08 +03:00
parent 51fe7cf2ff
commit e6eda2d0be
14 changed files with 165 additions and 54 deletions
+20
View File
@@ -107,6 +107,26 @@ kit.ready(['collection'], function () {
}), undefined, 'first');
assertSame(collection.keys().count(), 3, 'keys');
x = new kit.Collection({1: 1, 100: 100});
x.push(200);
assertSame(x.last(), 200, 'object push last');
x.push(0);
assertSame(x.last(), 0, 'object push last');
x.push(undefined);
assertSame(x.last(), undefined, 'object push last');
x.push('window');
assertSame(x.last(), 'window', 'object push last');
assertSame(x.get(x.lastKey()), 'window', 'get lastKey');
x = new kit.Collection([1, 100]);
x.push(200);
assertSame(x.last(), 200, 'array push last');
x.push(0);
assertSame(x.last(), 0, 'array push last');
});
</script>