JS Flashcards

To improve retention of core JavaScript concepts

1
Q

What is the command line?

A

Program in the computer that allows you to issue direct commands to the computer

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

What is scope?

A

How accessible a variable is within your script

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

What is a code block?

A

Anything within { }, except an object

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

Local scope versus Global scope

A

In local scope, can access variables declared locally and globally. In global scope, can only access global variables

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

What is data?

A

Data is a sequence of characters or symbols on which operations are performed by a computer

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

What’s a data type?

A

Extra info about data that tells the computer how to deal with it and how to store it.

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

What’s a program?

A

A series of instructions that perform a task, executed by a computer

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

What are the data types of JavaScript?

A

1) string 2) number 3) boolean 4) null 5) undefined

6) object (a complex data type)

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

Which value in JS is not strictly equal to itself and why?

A

NaN. Because NaN is like an undefinable number. NaN is unordered. It is not equal to, greater than or less than anything, including itself

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

Loosely typed language means what?

A

JS is loosely typed in that it guesses what each data type is. JS does not require type declaration

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

What is an API?

A

Application Programming Interface. It facilitates communication between a client and a server

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

What is a server?

A

A computer program or device that accepts and responds to requests made by another program, often a client. A server manages network resources

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

What is a client?

A

The opposite of a server. The thing that sends a request to a server

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

What is a REST API?

A

REST is Representational State Transfer. A REST API follows a specific architectural style in how the data stored is arranged and how the API communicates with clients

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

JSON and how it differs from JS.

A

JavaScript Object Notation. It has all the JavaScript data types except functions.

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

What is Cache?

A

Hardware or software used to store something, often temporarily

17
Q

What is HTTP?

A

Hypertext Transfer Protocol. Its a set of rules through which browsers and servers communicate on the web

18
Q

What is an endpoint?

A

An API term. It’s the URL that points to the data in the API

19
Q

AJAX

A

Asynchronous JavaScript and XML. It’s a set of techniques using different web technologies on the client side to run asynchronous processes

20
Q

Asynchronous

A

Not at the same time. When something in the program is operating independently of other processes

21
Q

What are ‘props’ in react?

A

A prop is a property on a react element, and is represented as an object of its own properties which include the element’s content (children) and attributes like ‘id’, ‘src’, etc.

22
Q

Syntax parser

A

A program that reads your code and determines what it does, what it contains, and if its grammar is valid

23
Q

Lexical environment

A

It’s where something sits physically in the code. When lexical environment matters, it means that where you write something (eg. a variable) matters to the syntax parser.

24
Q

Execution context

A

A wrapper to help manage the code that is actually running

25
Q

An object

A

In JS, it’s a collection of name-value pairs.

26
Q

Global

A

Not inside a function

27
Q

What are the characteristics of Var?

A

Var declarations are 1) function scoped. They can be accessed anywhere within the function 2) can be redeclared with a new value 3) hoisted to the global object with the value of undefined.

28
Q

What are the characteristics of let?

A

1) Is block scoped {}. Only available and declared within the block. 2) can be reassigned ( actor = “chris pratt”) but NOT redeclared in the same scope (let actor = “ethan hawke”) 3) hoisted, but just the variable name - no value is provided unless you set one

29
Q

What are the characteristics of const

A

1) Block scoped (as is let). 2) Cannot be redeclared or reassigned. 3) If its an object however, the properties can be updated or reassigned

30
Q

What’s Babel?

A

It is an open source program that allows you to write ES6 code that is then made backwards compatible with older browsers

31
Q

What’s webpack?

A

It’s a bundler (or module builder) based in JavaScript that figures out all the dependencies in your code then puts together a minimalist version that can be plugged into your HTML file and run.

32
Q

The DOM

A

The DOM is an API for HTML (and XML documents). The DOM is a structural representation of your HTML document that allows you to interact with the document using JavaScript

33
Q

What are falsy values. Is an empty array truthy or falsey?

A

A falsy value in JS is a value that is considered ‘false’ when evaluated in a Boolean context.

The JS falsy values are: 0, null, undefined, “ “, false, NaN.

Everything else is truthy, including an empty array and empty object