I try to create a test where I send objects to a server, these objects have the same structure and they have a property whose value is a timestamp.
arrayItem: Item[] = [
{ref: "toto", zone:"zone11", stamp: Date.now()},
{ref: "tutu", zone:"zone22", stamp: Date.now()},
{ref: "titi", zone:"zone33", stamp: Date.now()},
{ref: "truc", zone:"zone44", stamp: Date.now()}
]
I would like to know how I can check if 2 timestamp or more are identical in order to create an alert and prevent sending to server.
to be clearer, if ever a timestamp is identical whatever the position of the object, I would like to generate an error. For now I try to create a nested loop
arrayItem: Item[] = [
{ref: "toto", zone:"zone11", stamp: 999999999},
{ref: "tutu", zone:"zone22", stamp: 111111111},
{ref: "titi", zone:"zone33", stamp: 777777777},
{ref: "truc", zone:"zone44", stamp: 111111111}
]
===. Or is there more to the question?