-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathsolution.ts
More file actions
31 lines (26 loc) · 861 Bytes
/
solution.ts
File metadata and controls
31 lines (26 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
- This solution.ts file is an example; replace it with your own code.
- Use the same function names and parameter names as in the problem statement.
- Write only the code inside the function bodies and return the result.
- Do not use any console.log statements or comments.
*/
const getSwallowVelocity = (type: 'african' | 'european'): string => {
if (type === 'african') {
return 'Roughly 11 meters per second.';
}
return "I... I don't know that!";
};
const isCatLiquid = (isAsleep: boolean, containerShape: string): boolean => {
return isAsleep && containerShape !== 'none';
};
class Wizard {
name: string;
favoriteSpell: string;
constructor(name: string, favoriteSpell: string) {
this.name = name;
this.favoriteSpell = favoriteSpell;
}
castSpell(): string {
return `${this.name} casts ${this.favoriteSpell}!`;
}
}