Page 267 - Web_Application_v2.0_C12_Fb
P. 267
Recap Zone
In JavaScript, strings are collections of characters.
In JavaScript, almost everything is an object except for six primitive types: null, undefined, strings,
numbers, Booleans, and symbols.
A block of code created specifically to carry out a specific task is referred to as a JavaScript function.
prompt( ) method asks the user to enter a value. It has two buttons, one for ‘Ok’ and one for ‘Cancel’.
The confirm( ) method is used to obtain confirmation from the user about an action.
The String object offers formatting and string manipulation methods and properties.
Numerous mathematical operations are supported by the Math object.
Objects represent entities from the outside world that we want to express in our programs through
properties, and methods.
An array is a special variable, with the capacity to hold several values.
A block of code created specifically to carry out a specific task is referred to as a JavaScript function.
An event is defined as a change in an object's state.
The act of responding to events is known as event handling.
JavaScript uses event handlers to handle HTML events.
Solved Exercise
Section A
(Objective Type Questions)
A. Choose the correct option.
1. DOM stands for ................................
i. Document Open Model ii. Draft Object Model
iii. Document Object Model iv. Draft Open Model
2. In JavaScript, any object of any type can be assigned to any ................................
i. object ii. loop
iii. HTML form iv. variable
3. When a user enters incorrect information, the developer can utilise ............................... to show the user a warning
or error.
i. alert box ii. prompt box
iii. input box iv. None of these
4. ............................... inbuilt function returns an arbitrary value between 0 and 1.
i. randint( ) ii. randfloat( )
iii. random( ) iv. Floor( )
5. The act of responding to events is known as ................................
i. prompt handling ii. event handling
iii. programming iv. event handler
JavaScript Part 2 265

