Question 10
Consider the below JavaScript program.
const obj = [{ id: "1"}, { id: "2"}, { id: "3"}, { id: " 4"}, { id: " 5 "}];const finalObj = obj.map((element) => element.id).map((element) =>element.trim()).map((element) => parseInt(element)).filter((element) =>element % 2);console.log(finalObj, finalObj.length);What will be the output of the above program, if executed?
[‘1’, ‘3’, ‘5’] 3
[‘2’, ‘4’] 2
[1, 3, 5] 3
[2, 4] 2
[‘1’, ‘2’, ‘3’, ‘4’, ‘5’] 5
[1, 2, 3, 4, 5] 5