• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 7 pages
Exam (elaborations)

Javascript Practice Exam Questions And Answers All Correct

Document preview thumbnail
Preview 2 out of 7 pages

JAVASCRIPT PRACTICE EXAM QUESTIONS AND ANSWERS ALL CORRECT

Content preview

JAVASCRIPT PRACTICE EXAM
QUESTIONS AND ANSWERS ALL
CORRECT

How does a reference type name differ from that of a variable? - Answer-A reference
type name starts with an upper case letter

What does the "this" keyword refer to? - Answer-The "this" keyword refers to the object
instance of the reference type

What is the advantage of using "get" and "set" property definitions? - Answer-Since
JavaScript automatically creates objects, if you misspell a property name, a new
property can be created. Creating the set and get property methods prevents this issue


What is the top level of the BOM and what is its purpose - Answer-The window object
which represents the frame of the browser. Everything associated with it including the
scroll bars, navigator bar icons and so on.

What represents the page in the BOM - Answer-The document object

What can you do from the windows object - Answer-- determine the browser
- determine the pages visited
- size of the user's screen
- change text in browser status bar
- change page that is loaded
- open new windows

Which object is the global object - Answer-- the windows object is the global object
- you can access it's properties from anywhere in the web page
- you do not need to use the windows. to access the properties and methods

How can you tell the difference between a property and a method? - Answer-The
method ends with ()

List Windows objects common to all browsers and their scope - Answer-- document - all
elements and objects on a page

, - three collections - links, images, forms
- navigator - information about the browser & OS
- screen - display capabilities
- location - current page's location
- history - all pages the user has visited


What is the syntax to reference an external JavaScript file? - Answer-<script type =
"text/javascript" src="filename.js"></script>

What is the syntax of an if statement - Answer-var myVariable;
if (myVariable == 1)
{
do something
}

What are the main collections of the document object - Answer-forms, images and links

Name some of the events for a web page - Answer-onload, onunload, links[0].onclick

What do you return if you want an onclick event not to go through - Answer-return true;

what are two ways to connect an onclick event to a hyperlink? - Answer-1) add an
onclick tag inside the "a href" tag
2) add window.document.link[0].onclick = <function>

How do you throw and catch an exception - Answer-try
{throw exception;}
catch(exception){alert("here is the error");}

does JavaScript have classes? - Answer-No, JavaScript has an equivalent named a
reference type.

What three things does a reference type consist of? - Answer-- Constructor
- Method Definitions
- Properties

write out a constructor containing the following parameters - Answer-function
CustomerBooking (bookingId, customerName, film, showDate)
{
this.customerName = customerName;
this.bookingId = bookingId;
this.showDate = showDate;
this.film = film;
}

Document information

Uploaded on
July 14, 2025
Number of pages
7
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$13.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Scholarsstudyguide
3.8
(169)
Sold
854
Followers
476
Items
16408
Last sold
1 day ago




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions