Up and Going Flashcards

1
Q

Javascript is to Java as

A

Carnival is to Car

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

Javascript gets its procedural roots from

A

C and a little Scheme/Lisp style functional roots

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

Definition of computer language

A

Rules for valid format and combinations of instructions ( aka syntax)

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

Code def

A

Set of special instructions to tell code what to do

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

Statement def

A

Group of words, numbers and operators to perform a specific task

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

Expression def

A

any reference to a variable or value

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

Call expression

A

A function

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

Interpreter or compiler def

A

A special utility on a computer that translates codes into commands

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

Interpretted vs compiled

A

Interpreted runs line by line. Compiled translates ahead of time and runs later

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

How does Javascript interpret/compile?

A

Compiles on the fly and runs the compiled code

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

+= -= are known as

A

Compound assignment. Combines a math operation with an assignment

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

== is called

A

loose equals

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

=== is called

A

strict equals

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

Basic types like boolean and string are refered to as

A

Primitive types

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

Conversion between value types is called

A

Coercion

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

To convert “42” to 42

A

Number(“42”)

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

Comments should explain

A

Why not what

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

Static typing is AKA

A

type enforcement

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

Strong typing

A

Variable type cannot change (like string to integer)

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

Weak typing

A

Variable type can change

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

Weak typing is AKA

A

dynamic typing

22
Q

Primary purpose of variables

A

To manage program state

23
Q

To make variable foo 245.654 to 2 decimal places

A

foo.toFixed(2)

24
Q

Block def

A

A series of statements put together

25
Q

Falsey def

A

Anything that is false in a boolean

26
Q

Technical term for scope

A

Lexical scope

27
Q

Scope def

A

Collection of variables and rules for variables accessible by name

28
Q

To find type of foo

A

typeof foo

29
Q

typeof returns which possible types (7 as of ES6)

A
undefined
string
number
boolean
object
function
30
Q

Why is typeof null an object?

A

Long standing bug with too much legacy to change

31
Q

obj[“a”] style and obj.a style names

A

bracket notation and dot notation

32
Q

to make uppercase

A

sting.toUpperCase()

33
Q

Explicit coercion

A

You can see in code a type conversion
Example:
a = “42”
a = Number(a)

34
Q

To convert string to number

A

Number(“12”)

35
Q

Implicit Conversion

A
Cannot see the coercion in code
Example:
a = "43"
a = a + 1
a === 44
36
Q

Falsy values in JS

A
""
0
null
undefined
false
37
Q

Difference between == and ===

A
== checks for value with coercion allowed
=== checks for value and type
38
Q

A non-number string and a number with a comparison operator will always return
eg “a” > 3

A

False

39
Q

What are reserved words?

A

names that variables cannot have such as true or for

40
Q

Hoisting def

A

When a variable is declared to belong to the entire scope

41
Q

Why add a break to switch statements?

A

Cases will run with any matches. It’s not like if statements

42
Q

The one line if statement is known as the

A

“conditional operator” or “ternary operator”

43
Q

IIFE sf

A

Immediately Invoked Function Expressions

44
Q

What is a polyfill?

A

a new feature and producing a piece of code that’s equivalent to the behavior but is able to run in older JS environments

45
Q

Transpiling def

A

tool that converts your newer code into older code equivalents

46
Q

3 reasons to use new syntax even though it is transpiled (by things like babel)

A

Easier to read
Easier to maintain
Optimized for new browsers

47
Q

What is document in document.getElementBy

A

Global variable for browser code. It’s a special object often called a Host Object

48
Q

About the getElementById()

A

Not a normal JS function. It is an enterface built into the DOM from the browser

49
Q

Treaditionally the DOM and it’s objects were written in

A

C/C++

50
Q

Closure def

A

A way to remember and access a function’s scope

51
Q

What is the authors criticism of JS developers?

A

Serious developers in other languages put huge effort into learning the language whereas JS developers get content with their minimal amount

52
Q

Generators are

A

pausing yielding points in JS functions to be resumed asynchronously later