-
Notifications
You must be signed in to change notification settings - Fork 188
#1-4Task. Artiom Uradau #975
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?
Conversation
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.
I'll mark the PR as "Draft", please click "ready for review" when it will be finished. Thank you!
*/ | ||
function concatenateStrings(value1, value2) { | ||
throw new Error('Not implemented'); | ||
return value1+value2; |
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.
It is necessary to observe indents between operators
*/ | ||
function extractNameFromTemplate(value) { | ||
throw new Error('Not implemented'); | ||
return value.substring(7,value.length-1); |
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.
It is necessary to observe indents between operators
*/ | ||
function getCardId(value) { | ||
throw new Error('Not implemented'); | ||
let cards = ['A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K']; |
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.
Need to use "const"
*/ | ||
function getRectangleArea(width, height) { | ||
throw new Error('Not implemented'); | ||
return width*height; |
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.
It is necessary to observe indents between operators
*/ | ||
function getCicleCircumference(radius) { | ||
throw new Error('Not implemented'); | ||
return radius*2*Math.PI; |
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.
It is necessary to observe indents between operators
*/ | ||
function removeFalsyValues(arr) { | ||
throw new Error('Not implemented'); | ||
return arr.filter(elem => { |
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.
Here you can use simple option "filter(Boolean)"
*/ | ||
function getUpperCaseStrings(arr) { | ||
throw new Error('Not implemented'); | ||
let array = arr.map(elem => { |
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.
You can use return without variable.
Example: "arr.map(n => n.toUpperCase())"
*/ | ||
function toCsvText(arr) { | ||
throw new Error('Not implemented'); | ||
let array = arr.map(elem => { |
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.
Here you can use just "join('\n')"
function findAllOccurences(arr, item) { | ||
throw new Error('Not implemented'); | ||
let numberOfRepeatedChars = 0; | ||
arr.filter(elem => { |
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.
You can solve this using "filter" and "length" without counter
function getFalsyValuesCount(arr) { | ||
throw new Error('Not implemented'); | ||
let numberOfFalses = 0; | ||
arr.filter(elem => { |
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.
You can solve this using "filter" and "length" without counter
f49cd6a
to
9fa3ea8
Compare
https://travis-ci.com/github/uryadov1998/js-assignments/builds/182028664