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
Falsey def
Anything that is false in a boolean
26
Technical term for scope
Lexical scope
27
Scope def
Collection of variables and rules for variables accessible by name
28
To find type of foo
typeof foo
29
typeof returns which possible types (7 as of ES6)
``` undefined string number boolean object function ```
30
Why is typeof null an object?
Long standing bug with too much legacy to change
31
obj["a"] style and obj.a style names
bracket notation and dot notation
32
to make uppercase
sting.toUpperCase()
33
Explicit coercion
You can see in code a type conversion Example: a = "42" a = Number(a)
34
To convert string to number
Number("12")
35
Implicit Conversion
``` Cannot see the coercion in code Example: a = "43" a = a + 1 a === 44 ```
36
Falsy values in JS
``` "" 0 null undefined false ```
37
Difference between == and ===
``` == checks for value with coercion allowed === checks for value and type ```
38
A non-number string and a number with a comparison operator will always return eg "a" > 3
False
39
What are reserved words?
names that variables cannot have such as true or for
40
Hoisting def
When a variable is declared to belong to the entire scope
41
Why add a break to switch statements?
Cases will run with any matches. It's not like if statements
42
The one line if statement is known as the
"conditional operator" or "ternary operator"
43
IIFE sf
Immediately Invoked Function Expressions
44
What is a polyfill?
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
Transpiling def
tool that converts your newer code into older code equivalents
46
3 reasons to use new syntax even though it is transpiled (by things like babel)
Easier to read Easier to maintain Optimized for new browsers
47
What is document in document.getElementBy
Global variable for browser code. It's a special object often called a Host Object
48
About the getElementById()
Not a normal JS function. It is an enterface built into the DOM from the browser
49
Treaditionally the DOM and it's objects were written in
C/C++
50
Closure def
A way to remember and access a function's scope
51
What is the authors criticism of JS developers?
Serious developers in other languages put huge effort into learning the language whereas JS developers get content with their minimal amount
52
Generators are
pausing yielding points in JS functions to be resumed asynchronously later