fullstackopen icon indicating copy to clipboard operation
fullstackopen copied to clipboard

Bug in if statement part2/countries/components/Content.js

Open Smcelli opened this issue 3 years ago • 0 comments

If countries.length is 10 or 2, then countries[0] will be displayed as if it is the only country in the array. Change line 11 to "} else if ((countries.length > 1 || countries.length === 0) {" will avoid this, since countries.length >10 is handled in the previous if statement. The extra condition of "&& countries.length <10" is not needed.

Smcelli avatar Jan 04 '23 20:01 Smcelli