Skip to content

#1-4Task. Artiom Uradau#975

Draft
uryadov1998 wants to merge 3 commits into
ilya4321:masterfrom
uryadov1998:01-strings-tasks
Draft

#1-4Task. Artiom Uradau#975
uryadov1998 wants to merge 3 commits into
ilya4321:masterfrom
uryadov1998:01-strings-tasks

Conversation

@uryadov1998

Copy link
Copy Markdown

@KostyaKov KostyaKov left a comment

Copy link
Copy Markdown
Collaborator

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!

Comment thread task/01-strings-tasks.js
*/
function concatenateStrings(value1, value2) {
throw new Error('Not implemented');
return value1+value2;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It is necessary to observe indents between operators

Comment thread task/01-strings-tasks.js
*/
function extractNameFromTemplate(value) {
throw new Error('Not implemented');
return value.substring(7,value.length-1);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It is necessary to observe indents between operators

Comment thread task/01-strings-tasks.js
*/
function getCardId(value) {
throw new Error('Not implemented');
let cards = ['A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K'];

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Need to use "const"

Comment thread task/02-numbers-tasks.js
*/
function getRectangleArea(width, height) {
throw new Error('Not implemented');
return width*height;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It is necessary to observe indents between operators

Comment thread task/02-numbers-tasks.js
*/
function getCicleCircumference(radius) {
throw new Error('Not implemented');
return radius*2*Math.PI;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It is necessary to observe indents between operators

Comment thread task/04-arrays-tasks.js
*/
function removeFalsyValues(arr) {
throw new Error('Not implemented');
return arr.filter(elem => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Here you can use simple option "filter(Boolean)"

Comment thread task/04-arrays-tasks.js
*/
function getUpperCaseStrings(arr) {
throw new Error('Not implemented');
let array = arr.map(elem => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You can use return without variable.
Example: "arr.map(n => n.toUpperCase())"

Comment thread task/04-arrays-tasks.js
*/
function toCsvText(arr) {
throw new Error('Not implemented');
let array = arr.map(elem => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Here you can use just "join('\n')"

Comment thread task/04-arrays-tasks.js
function findAllOccurences(arr, item) {
throw new Error('Not implemented');
let numberOfRepeatedChars = 0;
arr.filter(elem => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You can solve this using "filter" and "length" without counter

Comment thread task/04-arrays-tasks.js
function getFalsyValuesCount(arr) {
throw new Error('Not implemented');
let numberOfFalses = 0;
arr.filter(elem => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You can solve this using "filter" and "length" without counter

@KostyaKov
KostyaKov marked this pull request as draft August 31, 2020 10:01
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