#include "nsTArray.h" nsTArrayIn this example, we create an nsTArray object of type int. We add some elements to the array using the AppendElement method. Finally, we call the Clear method to remove all the elements from the array. The Clear method is useful when you want to remove all the elements from the array and reclaim the memory occupied by them. It is also helpful when you want to reuse the array for storing new elements. Overall, the Clear method is a part of the Mozilla Gecko SDK library, which provides various functions and classes for building applications based on the Gecko engine.myArray; // Add some elements to the array myArray.AppendElement(1); myArray.AppendElement(2); myArray.AppendElement(3); myArray.AppendElement(4); // Clear the array myArray.Clear();