Page 83 - DCAP202_Fundamentals of Web Programming
P. 83

Fundamentals of Web Programming




                    Notes
                                                        Table 6.3:  Different  Methods  Used in  Array
                                     Method         Description
                                     concat()       Joins two or more arrays, and returns a copy of the joined arrays
                                     join()         Joins all elements of an array into a string
                                     pop()          Removes the last element of an array, and returns that element
                                     push()         Adds new elements to the end of an array, and returns the new length
                                     reverse()      Reverses the order of the elements in an array
                                     shift()        Removes the first element of an array, and returns that element
                                     slice()        Selects a part of an array, and returns the new array
                                     sort()         Sorts the elements of an array
                                     splice()       Adds/Removes elements from an array
                                     toString()     Converts an array to a string, and returns the result
                                                    Adds new elements to the beginning of an array, and returns the new
                                     unshift()
                                                    length
                                     valueOf()      Returns the primitive value of an array

                                   Self Assessment


                                   Fill in the blanks:
                                   17.  An ........................... is a special variable, which can hold more than one value, at a time.
                                   18.  Each element in the array has its own ........................... so that it can be easily accessed.

                                   6.10 Summary


                                      Java script is a browser-interpreted language that was created to access all elements of
                                       HTML and the browser.
                                      JavaScript is the scripting language implemented on web which is used to add several
                                       functionalities, validating the form, as well as communicating with servers etc.
                                      JavaScript is most commonly used as a client side scripting language.
                                      JavaScript is a scripting language designed primarily for adding interactivity to Web
                                       pages and creating Web applications.
                                      A program can do many things, including calculations, sorting names, preparing phone
                                       lists, displaying images, validating forms, ad infinitum.

                                      String literals are rows of characters enclosed in either double or single quotes.
                                      There are two types of data: primitive and composite.
                                      An array can hold all your variable values under a single name. And you can access the
                                       values by referring to the array name.

                                   6.11 Keywords

                                   Array: An array is a special variable, which can hold more than one value, at a time.
                                   Boolean literals: Boolean literals are logical values that have only one of two values,  true or
                                   false.

          76                                LOVELY PROFESSIONAL UNIVERSITY
   78   79   80   81   82   83   84   85   86   87   88