0% found this document useful (0 votes)
5 views2 pages

Grade 8 ch9

JavaScript is a high-level programming language primarily used for creating interactive web pages. Key concepts include variables, which are named storage locations for data, and dialogue boxes such as alert, confirm, and prompt, which facilitate user interaction. The language features include interactivity, client-side scripting, and support for object-oriented and asynchronous programming.

Uploaded by

b9790012212
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Grade 8 ch9

JavaScript is a high-level programming language primarily used for creating interactive web pages. Key concepts include variables, which are named storage locations for data, and dialogue boxes such as alert, confirm, and prompt, which facilitate user interaction. The language features include interactivity, client-side scripting, and support for object-oriented and asynchronous programming.

Uploaded by

b9790012212
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Chapter 9

Introduction to Javascript

1. Define JavaScript.

JavaScript is a high-level, interpreted programming language that is primarily known for its use
in web browsers to make web pages interactive. It enables dynamic content, client-side scripting,
and the creation of user interfaces.
2. Define a variable.

A variable in JavaScript is a named storage location that holds data values. It is defined using the
var, let, or const keyword, followed by the variable name.

3. Write another name for object in JavaScript.

Another name for an object in JavaScript is an associative array or simply an array.

4. Write the difference between confirm box and prompt box.

confirm() box: Displays a dialog box with OK and Cancel buttons. Returns true if OK is pressed
and false if Cancel is pressed.
prompt() box: Displays a dialog box with an input field and OK/Cancel buttons. Returns the
input value if OK is pressed and null if Cancel is pressed.

5. What is the difference between document.write() and document.writeln()?

document.write(): Writes content without adding a new line. It replaces the entire content if used
after the document has been fully loaded.
document.writeln(): Writes content and adds a new line after each call.

6. Discuss the characteristics of JavaScript dialogue boxes.

JavaScript dialogue boxes include alert b0oxes (for short messages), confirm boxes (for user
decisions), and prompt boxes (for accepting user input). They are non-blocking, synchronous,
and their appearance is controlled by the browser.

Long answer
1. Write a few points one should keep in mind while naming a variable.

a. Should begin with a letter, underscore (_), or dollar sign ($).


b. Can contain letters, digits, underscores, or dollar signs.
c. Should not be a reserved keyword.
d. Follows camelCase or snake_case convention for readability.

2. Write the features of JavaScript language.

Answer
a. Interactivity: Enables interaction with users on web pages.
b. Client-Side Scripting: Executed on the client's browser.
c. Object-Oriented: Supports object-oriented programming.
d. Asynchronous Execution: Supports asynchronous operations with callbacks and promises.
e. Dynamic Typing: Variables are not explicitly typed.
f. Event-Driven Programming: Responds to events triggered by user actions or the browser.

You might also like