Skip to content

Shershnev Pavel#20

Open
PavelShershnoyv wants to merge 2 commits into
RTF-TypeScript-2021:masterfrom
PavelShershnoyv:Shershnev_Pavel
Open

Shershnev Pavel#20
PavelShershnoyv wants to merge 2 commits into
RTF-TypeScript-2021:masterfrom
PavelShershnoyv:Shershnev_Pavel

Conversation

@PavelShershnoyv
Copy link
Copy Markdown

No description provided.

@sadyan42 sadyan42 assigned ievdokim and unassigned sadyan42 Nov 8, 2021
Copy link
Copy Markdown

@ievdokim ievdokim left a comment

Choose a reason for hiding this comment

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

Небольшие вопросики по 1 и 3 заданию.

Comment thread src/task_1/index.ts
public takeMoney(moneyUnits: IMoneyUnit[]): boolean {
for (let j = 0; j< moneyUnits.length; j++){
let canTake: boolean;
for (let i = 0; i < this._repository.length; i++) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

лучше всего использовать find

Comment thread src/task_1/index.ts Outdated
}
}
if (!canTake){
this._repository.push({ moneyInfo: { denomination: moneyUnits[j].moneyInfo.denomination,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

не совсем понял, почему нельзя было просто this._repository.push(moneyUnits[j])

Comment thread src/task_2/index.ts
public isCardTiedToUser(cardId: string): boolean {
return this._users.find(user => user.cards.find(
card => card.id === cardId)) !== undefined;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Зачёт. 2 бала

Comment thread src/task_3/index.ts Outdated
private changeUserName(newName: any): any {
private changeUserName(newName: string): boolean {
if (this._user !== null && this._user !== undefined) {
if (this._user.name !== newName) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

почему эту условие нельзя поднять выше и не плодить if ?

аналогичный вопрос ко всем методам.

Comment thread src/task_4/index.ts
case Currency.USD:
return Number(moneyUnits.moneyInfo.denomination) * moneyUnits.count * 70;
case Currency.RUB:
return Number(moneyUnits.moneyInfo.denomination) * moneyUnits.count / 70;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Зачёт. 2 бала

Comment thread src/task_5/index.ts
}

public convertMoneyUnits(fromCurrency: Currency, toCurrency: Currency, moneyUnits: IMoneyUnit): number {
return this._currencyConverterModule.convertMoneyUnits(fromCurrency, toCurrency, moneyUnits);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Зачёт. 2 бала

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.

3 participants