JSFiddle - React, Tailwind, and code Playground

by mrtoxas

JavaScript

const employeesDataSource = [{
    key: 0,
    name: 'Chelsea',
    tel: '(916) 429-3229',
    email: '[email protected]',
    position: 'Terrago',
    mod: 'Euron',
  },
  {
    key: 1,
    name: 'Tanner',
    tel: '(916) 594-3164',
    email: '[email protected]',
    position: 'Neteria',
    mod: 'Lunchpad',
  },
  {
    key: 2,
    name: 'Yang',
    tel: '(994) 442-3913',
    email: '[email protected]',
    position: 'Equico',
    mod: 'Musaphics',
  },
];

const newData = {
  key: 1,
  name: 'NewName',
  tel: 'NewTel',
  email: 'NewEmail',
  position: 'NewPosition',
  mod: 'NewMod',
}


/* employeesDataSource.forEach((e) => {
  if (e.key == newData.key) {
    e.name = newData.name;
  }
}); */

/* let new_array = arr.map(function callback( currentValue[, index[, array]]) {
    
} */


function newArr(){
	
}

console.log(newArr())




//console.log(employeesDataSource);