diff --git a/guide/english/typescript/array-type/index.md b/guide/english/typescript/array-type/index.md index 47b3e21550..c3b3bbf677 100644 --- a/guide/english/typescript/array-type/index.md +++ b/guide/english/typescript/array-type/index.md @@ -21,7 +21,7 @@ let names: Array = ['Javier', 'Emma', 'John', 'Sophia', 'Emma']; ## Built-in methods In Typescript's Array type you can use some built-in functions. Each type has common and unique methods. -Below you can read about the most used ones of the array type's methods. In the example, we will use the array declaration from above. +Below you can read about the most used methods of the Array type. In the example, we will use the array declaration from above. ### pop() Removes the last element from an array and returns with it. @@ -50,4 +50,15 @@ var reverseNames = names.reverse(); //reverseNames = ['Emma','Sophia','John','Emma','Javier'] ``` +### forEach() +Perform a designated task for every item in the array +```typescript +var exclamationPointNames = names.forEach(doSomething); +//doSomething = function (name: string, index: number) { +// name[i] = name[i] + "!"; +//} +//exclamationPointNames = ['Emma!','Sophia!','John!','Emma!','Javier!'] +``` + + [More methods and description at TutorialsPoint](https://www.tutorialspoint.com/typescript/typescript_arrays.htm)