Page 165 - DCAP202_Fundamentals of Web Programming
P. 165

Fundamentals of Web Programming




                    Notes          document.write(“Book  name  is  :  “  +  book.subject  +  “<br>”);
                                   document.write(“Book  author  is  :  “  +  book.author  +  “<br>”);
                                   </script>
                                   </body>
                                   </html>




                                      Task  Give examples of Math object and Date object.

                                   Self Assessment

                                   Fill in the blanks:
                                   11.  All  user-defined  objects  and  built-in  objects  are  descendants  of  an  object  called
                                       .............................
                                   12.  The .......................... operator is used to create an instance of an object.
                                   13.  A ............................ is a function that creates and initializes an object.

                                   14.  The ............................... contains a reference to the new object.
                                   15.  The properties assigned to  the object  are not  variables and  are not  defined with  the
                                       ............................... keyword.

                                   13.6 Summary


                                      In JavaScript, an object is a standalone entity, with properties and type.
                                      JavaScript’s Math object properties are treated as constants.
                                      The Date object is useful when you want to display a date or use a timestamp in some sort
                                       of calculation.
                                      JavaScript objects are collections of properties and methods. A method is a function that is
                                       a member of an object.

                                      A method is a function that is a member of an object.
                                      All objects in JavaScript support “expando” properties and methods, or properties that can
                                       be added and removed at run time.

                                      JavaScript provides all sorts of shortcut ways of specifying your code which makes the
                                       code quicker to write.

                                      JavaScript provides all sorts of shortcut ways of specifying your code which makes the
                                       code quicker to write.

                                   13.7 Keywords

                                   charAt(): This is a method returns the character at the index specified.
                                   getHours(): Returns the hour

                                   getMinutes(): Returns the minutes
                                   getSeconds(): Returns the seconds





          158                               LOVELY PROFESSIONAL UNIVERSITY
   160   161   162   163   164   165   166   167   168   169   170