Showing whether zjrJS.Doc. addArrayComprehension() actually works.
Preconditions
Javascript must be allowed to run on this page.
The version of zjrJS must be at least 20120504t1629. (Most of the Array Comprehension was added in version 20120411t0914.)
Successful When...
If the used browser natively supports array comprehension (MSIE anything older than the 9 version), the following fail before pressing the "Add Comprehension" button in the form, and succeed afterwards:
Javascript must be allowed to run on this page.
The version of zjrJS must be at least 20120504t1629. (Most of the Array Comprehension was added in version 20120411t0914.)
Successful When...
If the used browser natively supports array comprehension (MSIE anything older than the 9 version), the following fail before pressing the "Add Comprehension" button in the form, and succeed afterwards:
- In the form, pressing the List All button generates a listing of 3 fruits and 1 non-fruit in the Output box. The undefined item is ignored. This tests forEach().
- In the form, pressing the Get Fruits Only button filters the listing and shows only the 3 fruits in the Output box, omitting both the dumpling and the undefined item. This tests filter().
- In the form, pressing the Everything Is a Fruit button determines that not every item in the listing is a fruit, and presents this in the Output box. This tests every().
- In the form, pressing the Where is the Coconut? button determines that the position of the coconut in the dataset equals 3 (the coconut is the 4th item, and since javascript arrays start counting at 0, the 4th item has position 3), and presents this in the Output box. This tests indexOf().
- In the form, pressing the Tally Lengths button sums up the lengths of all 4 items to 26, and presents this in the Output box. This tests reduce().