Lesson 5: Introduction to JavaScript

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Which of the following is the most similar to JavaScript in purpose and implementation?

VBScript

A JavaScript rule concerning variables states that the first character of a variable name must be:

a letter, the underscore character ( _ ) or the dollar sign ( $ ).

What is Microsoft's implementation of JavaScript called?

JScript

The development of HTML5 APIs is expected to intensify as mobile devices continue to multiply. Which technology provides the advanced interactivity required for APIs?

JavaScript

Which of the following best describes the relationship between JavaScript and Java?

JavaScript and Java are different languages and have no relationship

What is the main characteristic of a programming language that distinguishes it from a scripting language?

Programming languages are traditionally compiled, whereas scripting languages are traditionally interpreted.

What term is a characteristic of an object that describes the object's attributes?

Property

Which statement about scripting languages is true?

Scripting languages sometimes provide less functionality than full programming languages, but are usually easier to learn.

Which of the following best describes an object-oriented program?

A collection of individual objects that perform different functions

Consider the following code: var birthYear = "1956"; What data type does the variable birthYear contain?

The string data type

What kind of data would a Boolean data type store?

True or false values only

In JavaScript, how do you combine text strings, such as combining the prompt() and alert() methods to request user input and then display it?

Use concatenation to link two or more text strings.

Which statement is true regarding capitalization and variable names in JavaScript?

Variable names can be written in lowercase or uppercase, but it is good coding practice to use consistent capitalization for all names.

How should you embed JavaScript code in an HTML5 document to which you are also linking an external JavaScript file?

You must use separate <script> statements to call the external file and embed a separate script.

JavaScript is a scripting language for adding dynamic interactivity to Web pages. You can use JavaScript to:

interpret the script and return the appropriate responses on the client side or on the server side.

What term describes a self-contained programming component that can be used in various situations and in different places in an application?

Object

In which sections of an HTML document can you embed JavaScript code?

The <head> and/or the <body> sections

What is a variable in JavaScript?

A named space of memory that allows you to store a value

What is an expression in JavaScript?

A part of a statement that is evaluated as a value

Consider the following statement: src="script.js" In programming terms, what is the text "script.js" called?

A value

In programming, what should you use to instruct the program how to store or evaluate a value?

An operator

Consider the following expression: apartmentNumber = 523; What type of expression does this code snippet represent?

Assignment

Why is JavaScript relatively easy to learn?

Because JavaScript does not have all of the complex rules associated with full object-oriented languages

Why should you test your JavaScript code in multiple browsers?

Because JavaScript programs tend to be implemented differently in different browsers

Consider the following code: <!DOCTYPE html> <html> <head> <meta charset="utf-8"/> <title>Page Title</title> <script src="newScript.js"> </script> </head> <body> HTML page text goes here </body> </html> This is an example of what?

Calling external JavaScript

Which organization approved JavaScript as an international standard in 1997?

European Computer Manufacturer's Association (ECMA)

Which of the following is a characteristic of event-driven programming?

Events can trigger functions.

What type of language is HTML?

Markup language

Using JavaScript, you create a "ball" object and specify that the ball can be thrown, kicked, bounced, inflated or deflated. What term describes the actions you have specified for your "ball" object?

Methods

Consider the following expression: "Good morning, " + "Sarah"; What type of expression does this code snippet represent?

String

What step should you take to ensure that your JavaScript code runs as expected?

Test your code in various browsers.

Between which tag pair should you reference an external .js file in your HTML document when you want to add JavaScript from an external text file?

The <script></script> tag pair

In JavaScript, what is a literal?

The actual data value you provide in JavaScript

Which JavaScript method should you use if you want to display a message to the user in a pop-up box when the user opens your Web page?

The alert() method

Which JavaScript method should you use if you want to write a message to the user in your Web page as the page loads in the browser?

The document.write() method

Which variable data type represents a value of "nothing?"

The null data type

What variable data type should you use if you want to store numeric values that are to be used in mathematical calculations?

The number data type

Why should you use the JavaScript prompt() method?

To create a pop-up box with the specified message string and to request user input into a text field in the box


Set pelajaran terkait

Financial Management 3400 Chapter 2

View Set

Toth - 8th Gr. Final Exam Review - Semester 2

View Set

Chapter 1 - Sections 1.1 and 1.2

View Set

Chapter 42 Mental Health Questions

View Set

Biology Lecture Quiz: 2, 3, 4, 5.4

View Set

Year 11 Chemistry Lewis Structure and electron dot diagrams

View Set