AngularJS angular.forEach() Function (original) (raw)
Last Updated : 14 Feb, 2023
The angular.forEach() Function in AngularJS is used to iterate through each item in an array or object. It works similar to the for loop and this loop contains all properties of an object in key-value pairs of an object.
Syntax:
angular.forEach(object, iterator, [context])
Parameter Values:
- object: It refers to the object to be iterated.
- iterator: It refers to the iterator function(value, key, obj).
- context: This is optional. It refers to the object which becomes the context for the iterator function.
Example: This example describes the basic usage of the forEach() function in AngularJS.
HTML `
angular.forEach()GeeksforGeeks
angular.forEach()
Searching techniques:
- {{name}}
`
Output:
