Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

javascript get object id

const object = [
     {id: '11', name: 'ron' , surname: 'lesner' , group: 'A'},
     {id: '12', name: 'don' , surname: 'lesner' , group: 'B'},
     {id: '13', name: 'ton' , surname: 'lesner' , group: 'A'}
];

const found = object.find(item => item.id === '11').id;
console.log(found)
 
PREVIOUS NEXT
Tagged: #javascript #object #id
ADD COMMENT
Topic
Name
8+6 =