JS and React.js Flashcards

To learn technical jargon

1
Q

Linting

A

Software that screens code for syntax errors while differentiating various elements of code

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

I.D.E.

A

Integrated Development Environment

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

D.O.M.

A

Document Model Object

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

What must every component do?

A

*Render some code to the DOM

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

What 3 arguments are accepted by .createElement?

A

1) HTML Element
2) Configuration (JS object)
3) Children of Element

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

Var vs Const

A

Var: can change
Const: data never changes

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

Functional Components are written

A

const cmp = () => { return <div>some JSX</div> }

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

Class Components are written

A
class Cmp extends Component 
   { render () 
      { return <div>some JSX</div> } 
   }
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Dynamic Code within a JSX Element must be wrapped in?

A

Single curly braces:

{ dynamic code }

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

Children

A

Any Element that is contained between a Components opening and closing tags

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

Props

A

Used to dynamically pass code from parent components to child components

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

Dynamic Code

A

Not hard coded, code easily able to change

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

State

A

Is managed from within a component and if changed will cause a re-render.

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

Handlers

A

Class methods that are not actively being called but is triggered by an event

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

Should State should be mutated?

A

No

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

Mutate

A

To hard change data

17
Q

How do you inject JS expressions into JSX?

A

With single curly braces { }

18
Q

Turnery Operator

A
? = (if) 
\: = (else)
19
Q

.Map( ) does what?

A

Executes a method on an array

20
Q

Where is JSX written in React projects

A

After the Return

21
Q

Where is JS written in React projects

A

After the Render

22
Q

To properly use .Map( ) in needs to be placed on which Element?

A

The outer most Element

23
Q

What is a good file structure for a React App?

A

Src >
Components > (Components)
Assets > (Images)

24
Q

What is special about PureComponents

A

They have shouldComponentUpdate checks built in

25
Q

What is a HOC?

A

A Higher Order Component

26
Q

What is the proper way to update State within a setState call?

A

setState( ( prevState, props ) => { return {
statefulElement: prevState.method }
}
)

27
Q

How do ‘Switch’ statements work?

A

Switch statements take an expression which is evaluated against a set of CASEs to look for the first CASE with the matching expression. If no CASE matches the provided expression then a DEFAULT case is executed. Switch statements fun until a BRAKE is encountered. If more than one CASE matches the Switch will execute the first match and its associated statements.

28
Q

How should you name Global Constants?

A

In all CAPS and with _ between words.

29
Q

withRouter( ) gives you access to witch 3 methods?

A

.match( ), .history( ), and .location( )

30
Q

What is “escaping” in JS?

A

Escaping is using a / to tell the computer that the symbol coming after the backslash is to be interpreted as a string not as a operational value.

31
Q

What are the 6 JavaScript values?

A

1) Strings
2) Numbers
3) Booleans
4) Objects
5) Functions
6) Undefined

32
Q

What is an “Expression”?

A

An expression is a combination of values that are computed by the computer. An Expression results in a value.

33
Q

What is a “Statement”?

A

Statements are computer instructions. A Statement preforms a task.

34
Q

What are semi-colons used for in JS?

A

A semi-colon is used to separate statements.

35
Q

What is a Function?

A

A function is a repeatable block of code that executes certain actions and preforms tasks. You execute a function by calling it. This is also know as invoking the function.

36
Q

Koans

A

code learning website

37
Q

What does the Modulus operator do?

A

Returns the amount left over after a division.