Page 229 - Web Applications (803) Class 12
P. 229

Unsolved Exercise


                                                                Section A
                                                        (Objective Type Questions)
                 A.   Choose the correct option.
                     1.  There is a built-in object called ............................... to handle more advanced mathematical functions and constants
                      in JavaScript.                                                              [CBSE Sample Paper 2020]
                      i.  round                                         ii.  math
                      iii.  str                                         iv.  array
                     2.  Which of the following is an arithmetic operator in JavaScript?
                      i.  %                                             ii.  <
                      iii.  || (OR)                                     iv.  ? :
                     3.  The correct way of using the random function is ............................... .
                      i.  random()                                      ii.  RANDOM()
                      iii.  math.random()                               iv.  randint()
                     4.  What will be the output of the following JavaScript code:

                      var names = [“Gangubai”, “Tenalirama”, “Motu”, “Pappu”]
                      document.write(names.pop())
                      i.  Gangubai                                      ii.  Pappu
                      iii.  Tenalirama                                  iv.  Motu

                     5.  In JavaScript code, if a variable is declared using var in a for loop it can be accessed
                      i.  inside the loop only                          ii.  inside the entire function
                      iii.  inside the entire program                   iv.  Not available at all.

                 B.  Fill in the blanks.
                     1.  ............................... in-built function tells the datatype of a variable.

                     2.  ............................... are used to explain the code and make it more readable in JavaScript programs.
                                                                                           [CBSE Term 2 Sample Paper 2022]
                     3.  A JavaScript function can accept another function as a ................................

                     4.  The ............................... attribute in <script> tag specifies the location of the external JavaScript file.
                     5.  Numbers in JavaScript are double-precision ................................   [CBSE Sample Paper 2021]

                 C.  State whether the following statements are true or false.
                     1.  The object types in JavaScript are specified by their properties and methods.      ............................
                     2.  The function keyword in JavaScript causes the function to terminate.               ............................

                     3.  Events are a component of the Document Object Model (DOM) Level 3 and are present in only
                        a few HTML elements.                                                                ............................

                     4.  When a variable is declared but not given a value, its type is undefined by default.   ............................
                     5.  In >> bitwise operator, each bit is shifted towards left.                          ............................









                                                                                          Web Scripting—JavaScript   227
   224   225   226   227   228   229   230   231   232   233   234