Chrome Extension

Util Array Examples

const allLanguages = [ 'ES', 'EN', 'DE' ]
const usedLanguages = [ { id: 1, lang: 'EN' } ].map(e => e.lang);

var result = allLanguages.filter(e => !usedLanguages.includes(e));
console.log(result)


=================



 const myArrayFiltered = this.AllGroupActive.filter(array => this.workFrontAnomalyType.developmentStageGroupId.some(filter => filter === array.id ));
 const checkAllActive = myArrayFiltered.every(item => item.active);



 ===========================================================
var arr1 = ['a', 'b'];
var arr2 = ['a', 'b', 'c', 'd'];

  let intersection = arr1.filter(x => arr2.includes(x));
  let difference = arr1.filter(x => !arr2.includes(x));

   symmetric difference,

   let difference = arr1
                 .filter(x => !arr2.includes(x))
                 .concat(arr2.filter(x => !arr1.includes(x))); 
=======================

someValues.forEach((element, index) => {
    console.log(`Current index: ${index}`);
    console.log(element);
});

============

 removeAnomaly(anomaly: WorkFrontAnomaly){
        var index = this.workFrontAnomalies.indexOf(anomaly);

        if(index != -1){
            this.workFrontAnomalies.splice(index, 1);
        }
    }
We are a bunch of lazy programmers so we developed this chrome extension
search code from your favorite search engine
Install Now
Was this helpful?
0 Comments
Open Code Manager We are hiring