Skip to content

Conversation

@serhii-baksheiev
Copy link
Contributor

No description provided.


function wordCounter(sentence) {
let strToArr = sentence.split(' ');
let obj = strToArr.reduce(function(newValue, elem, index, arr) {
Copy link
Member

Choose a reason for hiding this comment

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

you can solve that task with 1 loop.

And yes .reduce fit very well for that task


function createHashTags(arr) {
let obj = arr.reduce(function(newValue, elem){
let companyName = elem.company;
Copy link
Member

Choose a reason for hiding this comment

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

I saw the same code in other repos :)

// * */

function filter (arr, callback, thisArg) {
let results = [];
Copy link
Member

Choose a reason for hiding this comment

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

what the third argument mean?
could you please explain why we need it?

Can you rewrite existing solution without third argument ?

@OlegLustenko OlegLustenko merged commit e42efc9 into master Jun 21, 2018
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.

3 participants