Open
Conversation
ievdokim
reviewed
Nov 15, 2021
ievdokim
left a comment
There was a problem hiding this comment.
Небольшие вопросики по 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++) { |
src/task_1/index.ts
Outdated
| } | ||
| } | ||
| if (!canTake){ | ||
| this._repository.push({ moneyInfo: { denomination: moneyUnits[j].moneyInfo.denomination, |
There was a problem hiding this comment.
не совсем понял, почему нельзя было просто this._repository.push(moneyUnits[j])
| public isCardTiedToUser(cardId: string): boolean { | ||
| return this._users.find(user => user.cards.find( | ||
| card => card.id === cardId)) !== undefined; | ||
| } |
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.
почему эту условие нельзя поднять выше и не плодить if ?
аналогичный вопрос ко всем методам.
| case Currency.USD: | ||
| return Number(moneyUnits.moneyInfo.denomination) * moneyUnits.count * 70; | ||
| case Currency.RUB: | ||
| return Number(moneyUnits.moneyInfo.denomination) * moneyUnits.count / 70; |
| } | ||
|
|
||
| public convertMoneyUnits(fromCurrency: Currency, toCurrency: Currency, moneyUnits: IMoneyUnit): number { | ||
| return this._currencyConverterModule.convertMoneyUnits(fromCurrency, toCurrency, moneyUnits); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.