-
Notifications
You must be signed in to change notification settings - Fork 24
Shershnev Pavel #20
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
base: master
Are you sure you want to change the base?
Shershnev Pavel #20
Conversation
ievdokim
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Небольшие вопросики по 1 и 3 заданию.
| 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++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
лучше всего использовать find
src/task_1/index.ts
Outdated
| } | ||
| } | ||
| if (!canTake){ | ||
| this._repository.push({ moneyInfo: { denomination: moneyUnits[j].moneyInfo.denomination, |
There was a problem hiding this comment.
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])
| public isCardTiedToUser(cardId: string): boolean { | ||
| return this._users.find(user => user.cards.find( | ||
| card => card.id === cardId)) !== undefined; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Зачёт. 2 бала
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
почему эту условие нельзя поднять выше и не плодить if ?
аналогичный вопрос ко всем методам.
| case Currency.USD: | ||
| return Number(moneyUnits.moneyInfo.denomination) * moneyUnits.count * 70; | ||
| case Currency.RUB: | ||
| return Number(moneyUnits.moneyInfo.denomination) * moneyUnits.count / 70; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Зачёт. 2 бала
| } | ||
|
|
||
| public convertMoneyUnits(fromCurrency: Currency, toCurrency: Currency, moneyUnits: IMoneyUnit): number { | ||
| return this._currencyConverterModule.convertMoneyUnits(fromCurrency, toCurrency, moneyUnits); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Зачёт. 2 бала
No description provided.