Page 14 - JavaScript
P. 14

Formatting console output                                                                          182

        Advanced styling                                                                                    182

        Using groups to indent output                                                                       183

          Clearing the console - console.clear()                                                             184

          Displaying objects and XML interactively - console.dir(), console.dirxml()                         184

        Chapter 24: Constructor functions                                                                   187

          Remarks                                                                                            187


          Examples                                                                                           187
            Declaring a constructor function                                                                 187

        Chapter 25: Context (this)                                                                          189


          Examples                                                                                           189

            this with simple objects                                                                         189
            Saving this for use in nested functions / objects                                                189

            Binding function context                                                                         190

            this in constructor functions                                                                    191

        Chapter 26: Cookies                                                                                 192

          Examples                                                                                           192


            Adding and Setting Cookies                                                                       192
            Reading cookies                                                                                  192

            Removing cookies                                                                                 192

            Test if cookies are enabled                                                                      192

        Chapter 27: Creational Design Patterns                                                              194

          Introduction                                                                                       194

          Remarks                                                                                            194

          Examples                                                                                           194

            Singleton Pattern                                                                                194

            Module and Revealing Module Patterns                                                             195

        Module Pattern                                                                                      195

        Revealing Module Pattern                                                                            195


        Revealing Prototype Pattern                                                                         196

          Prototype Pattern                                                                                  197
   9   10   11   12   13   14   15   16   17   18   19