Page 152 - Open Soource Technologies 304.indd
P. 152

Web Technologies-I                                             Deepak Mehta, Lovely Professional University



                   Notes                          Unit 7:  Multidimensional Arrays



                                   CONTENTS

 Contents                          Objectives
 Objectives    165                 Introduction
                                   7.1   Concept of Multidimensional Array
 Introduction  166
                                       7.1.1   Two-dimensional Arrays
                                       7.1.2   Three-dimensional Arrays
                                   7.2   Extracting Multiple Values
                                       7.2.1   Slicing an Array
                                       7.2.2   Splitting an Array into Chunks
                                       7.2.3   Keys and Values
                                       7.2.4   Checking whether an Element Exists
                                       7.2.5   Removing and Inserting Elements in an Array
                                   7.3   Converting between Arrays and Variables
                                       7.3.1   Creating Variables from an Array
                                       7.3.2   Creating an Array from Variables
                                   7.4   Traversing Arrays
                                       7.4.1   The for each Construct
                                       7.4.2   The Iterator Functions
                                       7.4.3   Using a for Loop
                                       7.4.4   Calling a Function for each Array Element
                                       7.4.5   Reducing an Array
                                       7.4.6   Searching for Values
                                   7.5   Sorting of Multidimensional Arrays
                                       7.5.1   User Defined Sorts
                                       7.5.2   Reverse User Sorts
                                   7.6   Acting on Entire Arrays
                                       7.6.1   Merging Two Arrays
                                       7.6.2   Calculating the Sum of an Array
                                       7.6.3   Filtering Elements from an Array
                                       7.6.4   Calculating the difference between Two Arrays
                                   7.7   Using Arrays
                                       7.7.1  Stacks
                                       7.7.2  Sets
                                   7.8  Summary

                                   7.9  Keywords
                                   7.10  Review Questions
                                   7.11  Further Reading



        146                               LOVELY PROFESSIONAL UNIVERSITY
   147   148   149   150   151   152   153   154   155   156   157