Open
Conversation
Comment on lines
5
to
7
| const numerator = Math.log10(x * x - 1); | ||
| const denominator = Math.log(a * x * x - b) / Math.log(5); | ||
| result.push(numerator / denominator); |
| @@ -0,0 +1,20 @@ | |||
| export function calcYA(a: number, b: number, x1: number, x2: number): number[] { | |||
| const result: number[] = []; | |||
| const xStep = 0.2; | |||
There was a problem hiding this comment.
почему это не параметр как остальные
| @@ -0,0 +1,20 @@ | |||
| export function calcYA(a: number, b: number, x1: number, x2: number): number[] { | |||
There was a problem hiding this comment.
плохое название для параметров x1, x2
|
|
||
| export function calcYB(a: number, b: number, xVal: number[]): number[] { | ||
| const result: number[] = []; | ||
| for (let i = 0; i < xVal.length; i++) { |
There was a problem hiding this comment.
мы не в golang обычно index.ts или по смыслу называют
|
|
||
| const result = calcYA(a, b, x1, x2); | ||
|
|
||
| const expected = [ |
There was a problem hiding this comment.
нам не важна такая точность можно проверить с округлением
| @@ -0,0 +1,52 @@ | |||
| import { calcYA, calcYB } from '../src/FunctionCalculate/calculate/calcFunction'; | |||
|
|
|||
| describe('CalcYA', () => { | |||
There was a problem hiding this comment.
Можно в обоих случаях добавить кейсы с изменением других параметров и проверки шагов
codewars/Array Deep Count/main.js
Outdated
| let count = 0; | ||
| for (let elem of a){ | ||
| if(Array.isArray(elem)){ | ||
| count += 1 |
| } | ||
|
|
||
| set setAge(newAge: number) { | ||
| if (newAge >= 0) { |
There was a problem hiding this comment.
поменяйте условие на обратное и уберите внутрь if выброс ошибки, так уберете return и будет выглядеть чуть лучше
| } | ||
|
|
||
| set setColor(newColor: string) { | ||
| if (newColor !== '') { |
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.