Javascript / JQuery / OOP / JSON (junior) Flashcards

(157 cards)

1
Q

What is a variable?

A

Where data can be stored!

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

Why are variables useful?

A

variable can be used to store and recall information through-out a program.

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

What two special characters can a variable begin with?

A

$ _

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

How do you declare a variable?

A

using a variable identifier

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

How do you assign a value to a variable?

A

= next to variable name

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

Are variables case sensitive?

A

yes

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

Which words cannot be used as variable names?

A

keywords (var, function, if) numbers..

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

What is a string?

A

Sub-series of characters that comes inside two ‘ or “

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

What is the string concatenation operator?

A

+

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

What is the difference when it comes to using single quotes or double quotes ( ‘ ‘ or “ “ )?

A

no difference in functionality

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

How do you escape quotation characters?

A

\ before the quote.

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

What is a number in JavaScript?

A

an integer

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

What is an arithmetic operator?

A

Mathematical function that takes two operands and performs a calculation on them.

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

Name four of the arithmetic operators?

A

add subtract

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

What is the order of execution?

A

PEMDAS

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

What is a boolean?

A

true / false

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

What is a comparison operator?

A

< = >

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

What is a comparison operator?

A

< = > == ===

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

What is a function?

A

Series of statements that are grouped together because they perform a specific task.

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

Why are functions useful?

A

you can reuse the function (rather than repeating the same set of statements).

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

How do you call a function?

A

function name followed by () with any argument inside.

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

What are the parts of a function definition?

A

function keyword, function name and code bloke inside curly braces.

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

What is the difference between a parameter and an argument?

A

methods are same as functions, except they’re created inside (and are part of) an object.

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

What is the difference between a parameter and an argument?

A

parameters are placeholders for values in function and arguments are the values when calling the function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Why is it important to understand truthy and falsy values?
They allow decision making
26
Why is the typeof an object null?
it's a bug!
27
What is the difference between null and undefined?
an undefined variable has no value, null has no specific value assigned to it but has a placeholder and act as an object ready to be assigned with a value.
28
What is the proper syntax for using the or operator?
|| double pipe
29
Why do you want to avoid using == for comparison?
== doesn't check on type similarity!
30
Do all if statements require an else statement?
no
31
What is the primary use case for switches?
comparing any individual value against a range of other individual values.
32
Does the default case have to be at the bottom of the switch statement?
to get executed after checking for all possible cases
33
Does the default case have to be at the bottom of the switch statement?
no!
34
What is an object in JavaScript?
A set of variables and functions grouped together.
35
How do you create an object literal?
declaring a variable with a name for object, equal sign, curly braces and key/value for each property or method in between separated by comma
36
What is a property in relation to JavaScript objects?
A set of key and value.
37
When should you use bracket notation over dot notation with objects?
any time there's illegal property name dot notation needs to be used to access the value
38
How do you remove a property from an object?
delete operator.
39
What is an array in JavaScript?
list of data
40
How do you create an array literal?
assigning data in brackets
41
What are the keys for the values inside an array?
index numbers.
42
Arrays have a property named length. Because arrays have a properties, what other data structure are they similar to?
objects
43
What are some good use cases for using objects inside arrays?
online shopping card with list of items and their properties (price, ..)
44
What is the primary advantage to storing your selected elements in a variable?
so they can be reused every time without a need to target them again
45
Why might you need JavaScript to modify the DOM after the page loads?
adjustments and updates based on user behavior
46
How can you better prepare when writing HTML for DOM manipulation in your JavaScript code?
setting better structure and placement for items that are going to be manipulated
47
What are the differences between innertext and textContent?
textContent gets the content of all elements, including and