Skip to content

Commit cb20268

Browse files
committed
update content
Signed-off-by: Kirill Mokevnin <[email protected]>
1 parent cc72fae commit cb20268

File tree

5 files changed

+6
-26
lines changed

5 files changed

+6
-26
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
// BEGIN
12
function compact(items: (number | null)[]) {
23
return items.filter((item) => item !== null);
34
}
5+
// END
46

57
export default compact;

modules/22-arrays/50-tuples/description.ru.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ theory: |
5858
5959
instructions: |
6060
61-
Создайте алиас `Point` описывающий точку в пространстве, то есть состояющую из трех координат: x, y, z. Экспортируйте его. Реализуйте функцию `isTheSamePoint()`, которая проверяет две точки на их одинаковое расположение. Две точки совпадают если совпадают все их координаты:
61+
Создайте тип `Point` описывающий точку в пространстве, то есть состояющую из трех координат: x, y, z. Экспортируйте его. Реализуйте функцию `isTheSamePoint()`, которая проверяет две точки на их одинаковое расположение. Две точки совпадают если совпадают все их координаты:
6262
6363
```typescript
6464
const p1: Point = [1, 3, 4];

modules/22-arrays/50-tuples/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
// BEGIN
12
export type Point = [number, number, number];
23

34
function isTheSamePoint(p1: Point, p2: Point): boolean {
45
return p1[0] === p2[0] && p1[1] === p2[1] && p1[2] === p2[2];
56
}
7+
// END
68

79
export default isTheSamePoint;
Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1 @@
1-
// BEGIN
2-
type MyArray<T> = {
3-
items: Array<T>;
4-
push(value: T): number;
5-
filter(callback: (value: T, index: number) => boolean): MyArray<T>;
6-
};
7-
// END
8-
9-
export default MyArray;
1+
console.log('lala');
Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,2 @@
1-
import MyArray from './index';
2-
31
test('function', () => {
4-
const coll: MyArray<number> = {
5-
items: [],
6-
push(value) {
7-
return this.items.push(value);
8-
},
9-
filter(callback) {
10-
const newItems = this.items.filter(callback);
11-
return { ...this, items: newItems };
12-
},
13-
};
14-
15-
expect(coll.push(1)).toBe(1);
16-
expect(coll.push(2)).toBe(2);
17-
expect(coll.push(5)).toBe(3);
182
});

0 commit comments

Comments
 (0)