We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 36d8ef5 commit fdbc692Copy full SHA for fdbc692
Array Methods/forEach.js
@@ -0,0 +1,18 @@
1
+// forEach
2
+// does not return new array
3
+
4
+const people = [
5
+ { name: 'bob', age: 20, position: 'developer' },
6
+ { name: 'peter', age: 25, position: 'designer' },
7
+ { name: 'susy', age: 30, position: 'the boss' },
8
+];
9
10
+function showPerson(person) {
11
+ console.log(person.position.toUpperCase());
12
+}
13
14
+// people.forEach(showPerson);
15
16
+people.forEach(function (item) {
17
+ console.log(item.position.toUpperCase());
18
+});
0 commit comments