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

10.  A function defined inside another function is called ............................... function.
                    i.  joined                                        ii.  nested
                    iii.  double                                     iv.  embed

                     Ans.  1.  ii    2.  iii   3. iv    4. i     5. iii   6. ii    7. iii   8. iv    9. iii   10. ii


              B.  Fill in the blanks.
                  1.  NaN stands for ................................

                  2.  A JavaScript variable is also known as ................................
                  3.  JavaScript is typically embedded into an HTML document using the ............................... tag.
                  4.  ............................... represent entities from the outside world that we want to express in our programs through
                    properties, and methods.
                  5.  If you want the user to enter a value before seeing a page, a ............................... box is frequently utilised.
                  6.  When a variable is declared but not given a value, its type is ............................... by default.
                  7.  JavaScript uses ............................... to handle HTML events.

                  8.  The ............................... function returns the location of a value’s first appearance in a string.
                  9.  The values that the function receives when it is called are known as ............................... for the function.
                 10.  A return statement in JavaScript causes the function to ................................


                  Ans.  1. Not a Number         2. identifier        3. script       4. Objects           5. prompt
                       6. undefined             7. event handlers    8. indexOf      9. arguments         10. terminate


              C.  State whether the following statements are true or false.

                  1.  When JavaScript is used as an event handler, it interacts with HTML elements.       ............................
                  2.  The switch statement is used to pick many code blocks to be performed.              ............................
                  3.  An event is a change in an object’s state.                                          ............................
                  4.  Curly brackets, {}, are not mandatory in a JavaScript function.                     ............................
                  5.  Strings are collections of 64-bit numbers.                                          ............................

                  6.  An event occurs when a user hits a button.                                          ............................
                  7.  The inbuilt function unshift( ) finds a match within a string.                      ............................
                  8.  JavaScript is an interpreted programming language.                                  ............................
                  9.  JavaScript can only be used at the server-side.                                     ............................

                 10.  The inbuilt function substring( ) returns the position of the first match.          ............................

                 Ans.  1.  True   2.  False   3. True   4. False   5. False   6. True   7. False   8. True   9. False   10. False

                                                              Section B
                                                     (Subjective Type Questions)
              A.  Short answer type questions.

                  1.  Which of the following are valid JavaScript variable names?
                     Add, function, average1, my.name, NaN, 2ndobject, obj_hello, wellness     [CBSE Sample Paper 2020]

               Ans.  Add, average1, obj_hello, wellness

                220   Touchpad Web Applications-XII
   217   218   219   220   221   222   223   224   225   226   227