I have a function getTeilnehmer(id)
which gets some mail addresses from a Sharepoint list and returns them as array. Now I have this function:
async function signUp(id, userId) {
let alleTeilnehmer = await getTeilnehmer(id);
alleTeilnehmer.push('[email protected]');
alleTeilnehmer.push('[email protected]');
console.log(alleTeilnehmer);
alleTeilnehmer.forEach( t => {
console.log(t);
});
};
The output on the console is:
> (2) ['[email protected]', '[email protected]']
0: "[email protected]"
1: "[email protected]"
2: "[email protected]"
3: "[email protected]"
length: 4
> [[Prototype]]: Array(0)
[email protected]
[email protected]
Why does forEach
only log the pushed addresses and why only those adresses are shown in the first line of the output but when I expand this line there are the others that came from the function getTeilnehmer(id)
?