-
Notifications
You must be signed in to change notification settings - Fork 23
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
Cristhian ocola solve node js challenge #28
base: master
Are you sure you want to change the base?
Cristhian ocola solve node js challenge #28
Conversation
}; | ||
}); | ||
|
||
const callsResponse = { |
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.
We can return directly here instead of creating a constant just to return it later
return {
totalCalls: processedCall.length,
total: parseFloat(totalCost.toFixed(2)),
callsDetails: processedCall
}
@@ -39,6 +39,35 @@ | |||
* @returns {CallsResponse} - Processed information | |||
*/ | |||
|
|||
function callsCost(calls) { } | |||
function callsCost(calls) { | |||
|
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.
Apply formatting to files
@@ -26,6 +26,75 @@ | |||
* @returns {PeopleResponse} - Processed information | |||
*/ | |||
|
|||
function peopleInformation(people) { } | |||
|
|||
// function calculateAgeProm(people) { |
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.
Remove unused code
return acc; | ||
}, init); | ||
|
||
const PeopleResponse = { |
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.
return {
"ageProm" : Math.round(metrics.totalAge / people.length),
"heightProm" : Math.round(metrics.totalHeight / people.length),
"youngerPerson" : metrics.youngerPerson,
"tallerPerson" : metrics.tallerPerson,
}
|
||
let messageArray = message.split(''); | ||
|
||
let answer = model.split('').map((char) => { |
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.
return model.split('').map((char) => {
if(char === character && messageArray.length > 0){
return messageArray.shift();
}else{
return char;
}
}).join('');
No description provided.