I have 2 arrays:
Time Stamp Array:
var timeStamp = [["0:00","1:00"], ["2:00","3:00"]];
Time Label Reference:
var timeLabels = [
{ name: "0:00", present: true, label: ["0:00", "1:00"], alterName:"" },
{ name: "1:00", present: true, label: ["1:00", "2:00"], alterName:"" },
{ name: "2:00", present: true, label: ["2:00", "3:00"], alterName:"" }]
I wanted to use Lodash to filter through the TimeStamp array but the methods I want are exclusive to object arrays. I currently have a for loop and it is not very elegant.
Ultimately, I want to create a TimeLabels object array thats present field is set to True or False if the time is present in the first index of timeStamp.
Referencing the Time Stamp Array above, the result would be:
var timeResult = [
{ name: "0:00", present: true, label: ["0:00", "1:00"], alterName:"" },
{ name: "1:00", present: false, label: ["1:00", "2:00"], alterName:"" },
{ name: "2:00", present: true, label: ["2:00", "3:00"], alterName:"" }]
I'm more used to using lodash but I'm wondering if other methods would be better to construct the solution or if a for loop, which I'm currently using is ok.