Within my AngularJS controller, there is an associative array named 'contact' that I need to work with. My task involves extracting elements from the array that do not have a specific name. Below is my code snippet and the corresponding response for your understanding:
Here is the snippet of my controller code:
function onSuccess(contacts) {
console.log(contacts);
for (var i = 0; i < contacts.length; i++) {
var list = contacts[i].phoneNumbers;
console.log(list);
}
}
As shown above, this is my contacts
array structure:
[Contact, Contact, Contact, Contact, Contact, Contact, Contact, Contact]
- Detailed array structure follows -
Following execution, the console displays the contents of the list
array as seen below:
Array[8]
0:Array[1]
0:Object
id:"109"
pref:false
type:"other"
value:"1800-300-1947"
My goal is to extract the specific element value
from this array.