Skip to content

Conversation

AleshaKolesnikov
Copy link

This was referenced Aug 20, 2020
Copy link
Collaborator

@vramaniuk vramaniuk left a comment

Choose a reason for hiding this comment

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

I'll mark the PR as "Draft", please click "ready for review" when it will be finished. Thank you!

*/
function extractNameFromTemplate(value) {
throw new Error('Not implemented');
return value.substr(7,value.length-8);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please, don't use this deprecated method.
substring is preferable

Comment on lines 117 to 121
var newStr = '';
for (let i = 0; i < count; i++){
newStr += value;
}
return newStr;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Comment on lines 270 to 330
throw new Error('Not implemented');
var cards = "A♣','2♣','3♣','4♣','5♣','6♣','7♣','8♣','9♣','10♣','J♣','Q♣','K♣','A♦','2♦','3♦','4♦','5♦','6♦','7♦','8♦','9♦','10♦','J♦','Q♦','K♦','A♥','2♥','3♥','4♥','5♥','6♥','7♥','8♥','9♥','10♥','J♥','Q♥','K♥','A♠','2♠','3♠','4♠','5♠','6♠','7♠','8♠','9♠','10♠','J♠','Q♠','K♠";
var array = cards.split("','");

for (let i = 0; i < array.length; i++) {
return array.indexOf(value, 0);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Try do not use a loop for solving this task.
Just place the whole deck to array of strings and return index of search string

*/
function getRectangleArea(width, height) {
throw new Error('Not implemented');
return width*height;
Copy link
Collaborator

Choose a reason for hiding this comment

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

spaces between operators

*/
function getCicleCircumference(radius) {
throw new Error('Not implemented');
return (radius*2)*Math.PI;
Copy link
Collaborator

Choose a reason for hiding this comment

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

spaces between operators

function sortDigitNamesByNumericOrder(arr) {
throw new Error('Not implemented');
var digits = ['zero','one','two','three','four','five','six','seven','eight','nine'];
return arr.sort(function(a,b){
Copy link
Collaborator

Choose a reason for hiding this comment

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

spaces between parameters

*/
function getItemsSum(arr) {
throw new Error('Not implemented');
return arr.reduce((acc,v) => (acc+v), 0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

spaces between parameters and operators

*/
function findAllOccurences(arr, item) {
throw new Error('Not implemented');
return arr.reduce(function(acc,val){
Copy link
Collaborator

Choose a reason for hiding this comment

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

spaces between parameters

*/
function distinct(arr) {
throw new Error('Not implemented');
return Array.from(new Set(arr));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Excellent!!

throw new Error('Not implemented');
let result = null;
indexes.map((dimension, index) => {
if (index != indexes.length - 1) arr = arr[dimension];
Copy link
Collaborator

Choose a reason for hiding this comment

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

"operator !== is always preferable
sometimes ''!=' may cause an error
(check at console :
'0' != 0
and '0' !== 0)"

@vramaniuk
Copy link
Collaborator

Revert changes of this file task/10-katas-1-tasks.js
https://stackoverflow.com/questions/7147270/hard-reset-of-a-single-file

@vramaniuk vramaniuk marked this pull request as draft August 21, 2020 13:19
@AleshaKolesnikov AleshaKolesnikov marked this pull request as ready for review August 25, 2020 09:52
@vramaniuk
Copy link
Collaborator

Changes in file 10-katas-1-tasks.js shouldn't be in this PR.

Please, execute the command git checkout HEAD 10-katas-1-tasks.js

I'll mark the PR as "Draft", please click "ready for review" when it will be finished. Thank you!

@vramaniuk
Copy link
Collaborator

Selection_048

@vramaniuk
Copy link
Collaborator

Closing the PR as accepted! Thanks!

@vramaniuk vramaniuk closed this Aug 25, 2020
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