How can I find "firstname" with value "Anna" and display her "lastname" at the end using JavaScript? This is just a dummy example for me to understand how it works.
var employees = [
{
"firstName":"John",
"lastName":"Doe"
},
{
"firstName":"Anna",
"lastName":"Smith"
},
{
"firstName":"Peter",
"lastName":"Jones"
}
];
document.getElementById("demo").innerHTML =
employees.firstName;
<p id="demo"></p>