Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var h = 3;
- console.log(j(h,function(x){
- return [(new String(' ')).repeat(h-(x)), (new String('#')).repeat(x), ' ', (new String('#')).repeat(x)].join('');
- }));
- function j(h,provider) {
- let value = [];
- (new Array(h)).fill(0).forEach(function(v,i){
- value[i]=provider(i+1);
- });
- return value.join('\n');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement