Font size
WorksheetsJavascript
Total questions: 45
Worksheet time: 23mins
Which are the following are commands, (not variables)?
c.fillStyle = 'green';
color = 'pink';
c.fillRect(50, 120, 10, 300);
drawStackedBoxes(10, 10, 50, 100);
Ah! There's a bug in this command! How should we debug?
c.fillstyle = 'blue';
It should be "blue"
Capitalize the s
Add a space after "c."
Capitalize the f
I need some help assigning the value of 1 to the variable x. What should I do?
1=x;
=1x;
;=x1
x=1;
I used the (a) analogy to describe what a variable is.
A function is a series of (a) grouped together.
How many times can I use a function?
1 time
5 times
100 times
Infinite times (there is no limit)
Which of the following contain arguments?
function paintCanvas(color) {
function drawPlayer(x, y) {
drawCanvas();
drawPlayer(150, 20, 'red', 'blue');
Which of the following are examples of User Input?
Key Click
Button Click
Joystick
Eating
Why is the setInterval command useful?
We can loop a block of code infinite times
We create an interval of between the loops
We can tell the functions to run by themselves without calling them
We can automatically assign value to variables
Write any example of an if-else statement! Remember the one I used:
IF you eat all your dinner, then you can have dessert; ELSE (otherwise) you can just sit
here and watch everyone else have dessert.
The simplest data-storing structure in any programming language
Lists
Array
Queue
List
A programming language used for webpage functionality such as interactivity, data processing, animation, and development of purpose built apps such as mobile and desktop apps and more.
HTML5
CSS
JS
C#
These are any variable names listed within a function's argument definition.
example: myFunction(x, y)
Parameter
Literals
Constraints
Variables
Which of the following is NOT a valid starting character for JS variable names?
Uppercase Letter
Lowercase Letter
Dollar Sign
Underscore
This allows JS Scripts and applications to perform different actions based on given conditions.
Variables
Loops
Conditional Statement
Stacks
Which of the following is NOT a valid component of a function declaration?
Function keyword
Function name
Pair of Square Braces
Pair of Curly Braces
Which of the following is a symbol that must NOT be present in any JS Variable?
A
z
_
%
A property that contains a function definition.
Object Properties
Object Attributes
Object Methods
Objects
Method used to select the element with a given identifier represented by the HTML element property ID
getElementByClassName() method
getElementById() method
getId()
getElementByTagName()
Which of the following operator is used for the Assignment Operator?
==
!
=
+
Which of the Tag Pair is used to enable JS script writing in HTML?
<br>
<script>
<JS>
<code>
What is the symbol pair used to write a new line within a string values?
\*
\'
\n
\br
in JS, Arrays are considered as what type of programming concept?
Class
Variable
Object
Function
What is the symbol used for the INCREMENT operator in JS?
+
++
=
==
Using object constructors what specific keyword is used to create new object?
if
var
new
this
Which funtion is used when a JS application must ensure that the user gets the information that is displayed?
Alert box
Prompt Box
Combo Box
Confirm Box
Which of the following is NOT a valid keyword for JS
new
switch
synchronize
void
Conditions return values of which data type?
Integer
boolean
floating-point
string
file extension for external JS files
.javascript
.js
.jscript
.script
built in object in JS that allows a script to perform mathematical task
Arithmetic
Math Object
Operation Object
Mathematics Object
used to write comments
++
=
//
--
Which type of array declaration allows for greater simplicity?
Dynamic array
Array Literals
Standar Array Syntax
Specified array declaration
symbol pair used to code backspace within string value
\b
\bspace
\backspace
\n
Since JS functions allow reusability of code, how many times do written codes need too be DEFINED?
TWICE
THRICE
AS MANY AS POSSIBLE
ONCE
HOW MANY CSS PROPERTIES CAN BE SET AND MODIFIED USING JS?
1
HALF OF THE TOTAL NUMBER OF PROPERTIES
NONE
ALL PROPERTIES
