Skip to content

Commit 18d0752

Browse files
authored
Task #1 from callforward
https://t.me/callforward/3
1 parent d4e190f commit 18d0752

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

topics/complex.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,3 +367,18 @@ Additional restriction (optional) - you can't use if/switch/?: statements
367367
Create Promise implementation
368368

369369
NB: In fact it was pair programmng session but it could be meditative task, wich takes as much time as you have. It covers a lot of topics - async / flow / thenable-interface / functions / exceptions etc.
370+
371+
---
372+
```javascript
373+
ar arr = [1,2,42,3];
374+
var brr = [];
375+
376+
for (var i = 0; i < arr.length; i++) {
377+
if (arr[i] === 42) {
378+
// fill it as short as possible
379+
// to get brr equal to [1,2,3]
380+
}
381+
382+
brr.push(arr[i]);
383+
}
384+
```

0 commit comments

Comments
 (0)