Quiz
JavaScript 2
This quiz has question types that open in the usual player.
Questions in this quiz (25)
1A JavaScript ________ is a block of JavaScript code, that can be executed when "asked" for. For example, a _______ can be executed when an event occurs, like when the user clicks a button.
- Afunction
- Bvariable
- Cobject
- Doperator
2_______ scripts are practical when the same code is used in many different web pages.
- AExternal
- BInternal
- CInline
3JavaScript files have the file extension _____
- A.exe
- B.javaScript
- C.js
4You can place an external script reference in _______
- A<head>
- B<head> or <body>
- C<body>
- DNone
5Placing scripts in external files have the following advantages:
- AIt separates HTML and code
- BIt makes HTML and JavaScript easier to read and maintain
- CCached JavaScript files can speed up page loads
- DNone
6How to add several script files to one page
- A<script src="[myScript1.js,myScript2.js]"></script>
- B<script src="myScript1.js,myScript2.js"></script>
- C<script src="myScript1.js"></script>
<script src="myScript2.js"></script> - D<script src="(myScript1.js,myScript2.js)"></script>
7External scripts can be referenced with a ___________________
- Afull URL or with a path relative to the current web page
- Bfull URL
- Cpath relative to the current web page
- DNone
8JavaScript can "display" data in different ways:
Writing into an alert box, using [blank_start]window.alert()[blank_end].
Writing into the HTML output using [blank_start]document.write()[blank_end].
Writing into an HTML element, using [blank_start]innerHTML[blank_end].
Writing into the browser console, using [blank_start]console.log()[blank_end].- Awindow.alert()
- Bdocument.write()
- CinnerHTML
- Dconsole.log()
- Edocument.write()
- Fwindow.alert()
- GinnerHTML
- Hconsole.log()
- IinnerHTML
- Jwindow.alert()
- Kdocument.write
- Lconsole.log()
- Mconsole.log()
- Nwindow.alert()
- Odocument.write
- PinnerHTML
9A [blank_start]computer program[blank_end] is a list of "instructions" to be "executed" by the computer
- Acomputer program
- Bdigital list
- CSpreadsheet
10In JavaScript program instructions are called ____________
- Aobjects
- Bclass
- Carray
- Dstatements
11JavaScript statements are separated by ________
- AColons
- BPeriods
- CSemicolons
- DCommas
12In HTML, JavaScript programs can be executed by the ___________.
- AOperating System
- Bweb browser
13JavaScript statements are composed of the following:
- AValues
- BOperators
- CExpressions
- DKeywords
- EComments
- FNone of the above
14The JavaScript syntax defines two types of values: [blank_start]Fixed[blank_end] values and [blank_start]variable[blank_end] values.
- AFixed
- BUnfixed
- Cvariable
- Dunvariable
15Fixed values are called [blank_start]literals[blank_end]. Variable values are called [blank_start]variables[blank_end]
- Aliterals
- Bunliterals
- Cvariables
- Dunvariables
16The most important rules for writing fixed values are:
[blank_start]Numbers[blank_end] are written with or without decimals
[blank_start]Strings[blank_end] are text, written within double or single quotes- ANumbers
- BStrings
- CStrings
- DNumbers
17In a programming language, variables are used to [blank_start]store[blank_end] data values.
- Astore
- Bvariables
18JavaScript uses the [blank_start]var[blank_end] keyword to declare variables
- Avar
- Btypof
19An [blank_start]equal[blank_end] sign is used to assign values to variables.
- Aequal
- Bplus
20JavaScript uses [blank_start]arithmetic[blank_end] operators ( [blank_start]+ - * /[blank_end] ) to compute values
- Aarithmetic
- Bother
- C+ - * /
- DA B C D
21JavaScript uses an assignment operator ( ___ ) to assign values to variables
- A=
- B+
- C×
- D÷
22An [blank_start]expression[blank_end] is a combination of values, variables, and operators, which computes to a value.
The computation is called an [blank_start]evaluation[blank_end].
For example, 5 * 10 evaluates to 50- Aexpression
- Bconstant
- Cevaluation
- Dexpression
23JavaScript [blank_start]keywords[blank_end] are used to identify actions to be performed.
The [blank_start]var[blank_end] keyword tells the browser to create variables:- Akeywords
- Bvar
- Cvar
- Dtypeof
24In JavaScript, the first character must be a [blank_start]letter[blank_end], an [blank_start]underscore[blank_end], or a [blank_start]dollar sign[blank_end]
- Aletter
- Bperiod
- Cunderscore
- Dline
- Edollar sign
- Fstop sign
25Numbers are allowed as the first character when naming a variable
- ATrue
- BFalse
Information
- Description
- Quiz on JavaScript 2, created by Alex Thompson on 08/12/2016.
- Author
- Alex Thompson
- Language
- English
- Views
- 4
- Rating
- No ratings yet Rate this quiz