Ad
Code
Diff
  • function getGemsOfColor(color, gems) {
      return gems.filter(gem => gem.colors.includes(color)).map(it => {return it.name}).sort();
    }
    • function getGemsOfColor(color, gems) {
    • let temp_gems = [];
    • gems.filter(gem => gem.colors.includes(color)).forEach(gem => temp_gems.push(gem.name));
    • return temp_gems;
    • return gems.filter(gem => gem.colors.includes(color)).map(it => {return it.name}).sort();
    • }