2

Some of the things I'd point out in your code for improvements: Arrays can be a const since you will not modify the array itself but just push new elements to the array. In your functions sortAsc, sortDesc, you are iterating through arr just to make it lowercase and iterating through the array again in sortedList.sort(). In such scenarios, think about how ...


2

Review Your code is a good simple solution. The style is sloppy. The complexity is a bit high and the techniques uses are negatively impacting performance. The template literal call Array.split`+` always throws me, but I like it, your code reminds me to use it more often. General points Delimit all code blocks. Eg if(n==0) return ["0"] better ...


1

From a short review; Your own answer does read better map is the right approach I would go for filter instead of reduce (you only want 'true' values that are not keyword) I probably would have named total -> keys I prefer <verb><object> so combined -> addGroups If you dont use a falsy comparison, then you dont need to check for 'keyword' ...


1

Issues Lost resolution You are issuing promises without a guarantee of being able to handle all or some of the resolving promises. This will happen if promises resolve before you start the for await loop. The offending code is in the line this.forEach(p => p.then(v => this.#resolve(v), e => this.#reject(e))); The calls to this.#resolve and this.#...


1

Typos caled everytime -> called every time MAX_CARACTERS_PER_SEGMENT -> MAX_CHARACTERS_PER_SEGMENT max_caracters -> max_characters And my first language is not French, but shouldn't Votre message dépasse le nombre de {{max_caracters}} caracters be Votre message dépasse le nombre de {{max_characters}} caractères ? Language consistency Your UI is in ...


1

Your code does not perform very well, I suppose because of the double recursion within the f-method. It lacks readability: let's say you return to this code a year later: how long would it take to understand what you actually wanted to do? Always use strict equality comparison (n == 0 => n === 0). Readability can at least be enhanced by interpunction, ...


Only top voted, non community-wiki answers of a minimum length are eligible