mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-28 10:14:13 +00:00
feature(util) add forEach
This commit is contained in:
parent
7554d6c41a
commit
93b22b9fea
3 changed files with 41 additions and 9 deletions
|
|
@ -138,6 +138,26 @@
|
|||
|
||||
});
|
||||
|
||||
describe('forEach', function() {
|
||||
it('should call arrays forEach on any type', function() {
|
||||
var str = '',
|
||||
obj = {
|
||||
0: 'a',
|
||||
1: 'b',
|
||||
2: 'c',
|
||||
length: 3
|
||||
};
|
||||
|
||||
Util.forEach(obj, function(item) {
|
||||
str += item;
|
||||
});
|
||||
|
||||
str.should.be.equal('abc');
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
})();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue