TypeScript | Array forEach() Method
The Array.forEach() is an inbuilt TypeScript function which is used to calls a function for each element in the array.
Parameter: This method accepts two parameter as mentioned above and described below:
- callback : This parameter is the Function to test for each element.
- thisObject : This parameter is the Object to use as this when executing callback.
Return Value: This method returns created array.
Below example illustrate the Array forEach() Method in TypeScript.
11 89 23 7 98
1 4 9 16 25