Digital Tech and Innovations Javascript Fundamentals Test Flashcards

1
Q

What is the writing inside parenthesis called

A

An argument

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you make a comment javascript

A

//___

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you emphasize text
is this javascript or html?

A

<em></em> html

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

how do you bold something?
Is this html or java?

A

<b></b> html

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a string literal

A

Anything in quotes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does string in string literal mean

A

Series of characters, they don’t havre to make sense

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is Parenthisis and what is brackets

A

()
[]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a method

A

A specific tool that does something extremely specififc (eg document.write())

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Everything inside partenthisis is called an ___

A

Argument

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is variable declaration

A

When you declare or write a variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do you declare a variable of var a

A

var a;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is variable initialization

A

Defining a varibale

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do you do variable initilization of var a

A

var a = poo;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

A variable that does not have a value is ____

A

Undefined

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Can you declare and initialize at the same time

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are camel cases

A

lower case then upper case letters to read something easier

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

does case matter

A

yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Can you put spaces in variables

A

no

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Can variables begin with a number

A

no

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Can variables end with a number

21
Q

Can variables contain symbols

22
Q

How do you ask the user a question?

A

var b = prompt()

23
Q

How do you output with a variable you just made

A

alert(“hi” + b)

24
Q

What is a floating point number

A

A number with decimals

25
Whats the difference between 123 and "123"
123 is an integer and "123" is a string literal. Written out "123" would be 1,2,3
26
What is an integer
A whole number
27
What are the arithmetic operators?
+ - * /
28
What is an operator
used to assign values, compare values, perform arithmetic operations, and more.
29
What is the modulus operator
It returns the remainder of a division
30
Example of modulus
var tot = 5/2 document.write( modulus)
31
What does /t mean and where can you use it
tab forward alert
32
What does
mean and where can you use it
break/new line document.write
33
What is a shortcut of * something or adding something to a variable that you have defined (also explain in long terms what this is written out as)
var score = 10 score *= 10 score /= 10 (score = score * 10) (score = score / 10
34
Whats an increment operator? - example
- adding 1 to a variable z++; instead of z = z+1
35
Whats a decrement operator? - example
- subtracting 1 from a variable z--; instead of z = z-1
36
What is a numerical literal
a literal saved as a number that you can perform operations with
37
How do you change something from a string literal into a number
var b = Number(42)
38
How do you make someting into a floating point #
var b = Parse.float(42)
39
What is var b = Parse.float(42)
Turning a number into a floating poit number
40
How do you make a number down to two decimal places
number.toFixed(2)
41
How do you generate a random # between 0 and 1
var a = Math.random();
42
How do you find the smallest # in a line of #'s
var b = Math.min(45, 34, 67, 90, 126, 54, 39, -19);
43
How do you find the biggest # in a line full of #'s
var c = Math.max(45, 34, 67, 90, 126, 54, 39, -19);
44
How do you round a number
var d = Math.round(4.7);
45
How do you round a number always down
var e = Math.floor(4.7)
46
How do you round a number always up
var f = Math.ceil(4.7)
47
How do you generate pi
var g = Math.PI
48
How do you power a number
var h = Math.pow(2,4)
49
How do you generate a random number between 1 and 100?
var i = Math.floor(Math.random() * 100) + 1;