> For the complete documentation index, see [llms.txt](https://jen-hsuan-hsieh.gitbook.io/powershell-programming-and-relative-experience/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jen-hsuan-hsieh.gitbook.io/powershell-programming-and-relative-experience/chapter4_common_type_and_operation.md).

# Chapter4: Common Type

## This section contain the following items:

* 1.Array List and Operation
* 2.Array

## 1.Array List and Operation

* 1.Create an ArrayList and add/delete items
  * add/delete items

    ```
      $countries = New-Object System.Collections.ArrayList
      $countries.Add('India')
      $countries.Add('Taiwan')
    ```
  * delete items

    ```
      $countries.Remove('Taiwan')
    ```
  * delete all items $countries.Clear()
* 2.Traversal

  ```
    for($i=0; $i -lt $countries.Count; $i++)
    {
        $countries[$i]
    }
  ```

## 2.Array

* 1.Create a empty array

  ```
    $myArray = @()
  ```
* 2.Add Elements to array

  ```
    $myArray += 1
  ```
