1) Using syntax "var <variable_name> = new Array()"
2) Using syntax "var <variable_name> = [ ];"
Both these ways do the same exact thing.
It is generally very difficult (cumbersome) to output the value of an array on the screen. It is easier to view the content of an array in the Console itself. In order to do that use the syntax "console.log(<array_name>);" in your code.
For example, we have already populated an array called "topicList". To view it's content, inspect the element, and review the content of this array in the Console.
You can additional data (records/rows) to an array with the use of syntax "push". For example, to add the page called "User Preferences" to the list of pages you could use the following syntax: pageList.push("User Preferences");.
You can remove data (records/rows) from an array with the use of syntax "splice" and provide the function as parameters the starting position where to begin deletion (i.e. offset) and the number of records to delete. For example, to remove the third and fourth records from array pageList you would use the syntax: pageList.splice(2, 2);.
The "splice" syntax does more then just delete records from an array. It can also add records at specific offsets. In order to do that you would specify the position (offset) at which you want to insert a record, then pass 0 as the number of records you want to delete, and then pass the data you want to add to the array.
For example, to add the page called "File Manager" as the 3rd record you would use the following syntax: pageList.splice(2, 0, "File Manager");.
As you may have picked up, it is possible to replace one (or delete multiple) entries in an array, while inserting new records at the same time. For example, the following syntax would delete records 2 and 3, while inserting two new records at the same offset: pageList.splice(1, 2, "Data Dictionary", "Data Browser")