Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: math func lab + codewars #49

Open
wants to merge 7 commits into
base: Habibulina_Alina_Mihajlovna
Choose a base branch
from

Conversation

1inHab
Copy link

@1inHab 1inHab commented Oct 10, 2024

No description provided.

@@ -1 +1,34 @@
console.log('Hello world');
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Создай отдельный файл под эту лабу, в индексе либо храни экспорты, либо удали

rpgsaga/saga/src/index.ts Show resolved Hide resolved
console.log(`Ответы к задаче A: ${taskA(xStart, xEnd, xStep)}`);
console.log(`Ответы к задаче B: ${taskB(listX)}`);

export function death(x: number) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Укажи возвращаемый тип

return res;
}

export function taskA(xStarts: number, xEnds: number, xSteps: number) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Возвращаемый тип

return listOfRes;
}

export function taskB(listsX: Array<number>) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вместо Array<number> просто используй number[]. Возвращаемый тип

}

export function taskB(listsX: Array<number>) {
const listOfRes = [];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Укажи тип

}

export function taskA(xStarts: number, xEnds: number, xSteps: number) {
const listOfRes = [];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Укажи тип

console.log(`Ответы к задаче B: ${taskB(listX)}`);

export function death(x: number) {
const res = (Math.pow(Math.sin(x), 3) + Math.pow(Math.cos(x), 3)) * Math.log(x);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

можно сократить, добавив return сразу сюда

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants