Skip to content

Feat/challenge 2#3

Open
yasirelbouazzati wants to merge 20 commits into
mainfrom
feat/challenge-2
Open

Feat/challenge 2#3
yasirelbouazzati wants to merge 20 commits into
mainfrom
feat/challenge-2

Conversation

@yasirelbouazzati
Copy link
Copy Markdown
Owner

is almost complete

const COUNTRIES = ["United Kingdom", "Italy", "France", "Portugal", "Greece"];

const extractCountriesWithFiveCharactersOrFewer = function (countries) {
const countriesFilter = countries.filter((countrie) => {
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.

Suggested change
const countriesFilter = countries.filter((countrie) => {
const countriesFilter = countries.filter((country) => {

Comment thread 02-filter/getLongWords.js
return word.length >= 5;
};

const longWord = words.filter((word) => filterLongWords(word));
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.

Suggested change
const longWord = words.filter((word) => filterLongWords(word));
const longWord = words.filter(filterLongWords);

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.

IFX: use reduce

];

function getTotalVoters(voters) {
const totalVoters = voters.filter((voter) => voter.voted).length;
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.

Nice solution! Are you able to explain what is it doing? 😉

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.

IFX: use reduce

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.

IFX: use reduce

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.

FIX: add tests job

Comment thread package.json
"version": "1.0.0",
"type": "module",
"main": "index.js",
"dependencies": {
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.

We only need three devDependencies

"@babel/plugin-transform-modules-commonjs"
"jest"
"prettier"
FIX: remove all dependencies and install only required devDependencies.

Comment thread package.json
"prettier": "^3.2.2"
},
"name": "09_javascript_array",
"description": "<figure style=\"text-align: center\"> <img src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/6/6a/JavaScript-logo.png/640px-JavaScript-logo.png\" alt=\"DOM Tree\" width=\"100\" /> <figcaption>JavaScript</figcaption> </figure>",
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.

FIX: remove description

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