Digital Tech and Innovations Javascript Fundamentals Test Flashcards

You may prefer our related Brainscape-certified 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

A

yes

21
Q

Can variables contain symbols

A

No

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
Q

Whats the difference between 123 and “123”

A

123 is an integer and “123” is a string literal. Written out “123” would be 1,2,3

26
Q

What is an integer

A

A whole number

27
Q

What are the arithmetic operators?

A

+ - * /

28
Q

What is an operator

A

used to assign values, compare values, perform arithmetic operations, and more.

29
Q

What is the modulus operator

A

It returns the remainder of a division

30
Q

Example of modulus

A

var tot = 5/2
document.write( modulus)

31
Q

What does /t mean and where can you use it

A

tab forward
alert

32
Q

What does <br></br> mean and where can you use it

A

break/new line
document.write

33
Q

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)

A

var score = 10

score *= 10
score /= 10

(score = score * 10)
(score = score / 10

34
Q

Whats an increment operator?
- example

A
  • adding 1 to a variable

z++; instead of z = z+1

35
Q

Whats a decrement operator?
- example

A
  • subtracting 1 from a variable

z–; instead of z = z-1

36
Q

What is a numerical literal

A

a literal saved as a number that you can perform operations with

37
Q

How do you change something from a string literal into a number

A

var b = Number(42)

38
Q

How do you make someting into a floating point #

A

var b = Parse.float(42)

39
Q

What is var b = Parse.float(42)

A

Turning a number into a floating poit number

40
Q

How do you make a number down to two decimal places

A

number.toFixed(2)

41
Q

How do you generate a random # between 0 and 1

A

var a = Math.random();

42
Q

How do you find the smallest # in a line of #’s

A

var b = Math.min(45, 34, 67, 90, 126, 54, 39, -19);

43
Q

How do you find the biggest # in a line full of #’s

A

var c = Math.max(45, 34, 67, 90, 126, 54, 39, -19);

44
Q

How do you round a number

A

var d = Math.round(4.7);

45
Q

How do you round a number always down

A

var e = Math.floor(4.7)

46
Q

How do you round a number always up

A

var f = Math.ceil(4.7)

47
Q

How do you generate pi

A

var g = Math.PI

48
Q

How do you power a number

A

var h = Math.pow(2,4)

49
Q

How do you generate a random number between 1 and 100?

A

var i = Math.floor(Math.random() * 100) + 1;