Midterm Flashcards

1
Q

What was the original name for JavaScript?

A

LiveScript

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

What is the engine embedded in the browser called?

A

JavaScript Virtual Machine

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

What JavaScript engine runs in Chrome?

A

V8

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

What JavaScript engine runs in FireFox?

A

SpiderMonkey

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

Why is modern JavaScript known as a “safe” language?

A

No low-level access or memory or CPU

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

What are 3 great things about JavaScript?

A
  1. Full integration with HTML/CSS
  2. Simple things are done simply
  3. Supported by all major browsers and enabled by default
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does JSON stand for?

A

JavaScript Object Notation

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

What engine is Node.js built on?

A

V8

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

What is Node.js?

A

Cross-platform back-end JavaScript runtime environment

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

What are 5 main features of Node.js?

A
  1. Asynchronous and Event Driven
  2. Very Fast
  3. Single Threaded but highly scalable
  4. No buffering
  5. MIT License
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

When is it not advisable to use Node.js?

A

CPU intensive applications

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

What are the 5 best use-cases for Node.js?

A
  1. I/O bound applications
  2. Data Streaming apps
  3. DIRT
  4. JSON API based apps
  5. Single Page Apps
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is DIRT?

A

Data Intensive Real-time Applications

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

What character is used for Template Literals?

A

Backtick ( ` )

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

What 3 things can you do with a template literal?

A
  1. Multi-line strings
  2. String interpolation
  3. Tagged templates
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How do you specify a placeholder in a template literal?

A

${ expression }

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

What is the difference between ES6 and ES2015?

A

They are synonyms

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

How long do Node.js versions enter Current release status?

A

6 months

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

What happens after a Node.js version ends current status?

A

Odd numbers become unsupported, even numbers enter Active LTS status

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

What is LTS status with Node.js?

A

Long-term support

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

What are 2 major benefits of arrow functions?

A
  1. Clean and concise syntax
  2. More intuitive scoping and “this” binding
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Which version of Node are we using?

A

18

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

What is blocking code?

A

Execution of code pauses until read operation completes.

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

What is a callback function?

A

Any function passed as an argument to another function

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

What 2 parts does npm consist of?

A
  1. CLI tool
  2. Online repository
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

What 4 metadata are provided in the package.json

A
  1. name
  2. version
  3. description
  4. license
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

How do you create the package.json file?

A

npm init

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

How do you get around default node using CJS when considering modules?

A

In package.json add
“type” : “module”

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

What is a promise?

A

An object that holds the future value of an async operation

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

What are the 3 states of a promise?

A
  1. Pending
  2. Resolved
  3. Rejected
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

What 2 callback functions does a promise take?

A
  1. resolve
  2. reject
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

How do we consume a promise?

A

then() catch()

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

What does Promise.all take as input?

A

An array of promises

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

What is the rest operator?

A

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

What is the rest operator used for?

A

Used to pass a variable number of arguments to a function

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

In a list of parameters, which position must the rest operator be used?

A

Last

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

What is process.argv?

A

An array of command line arguments

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

What npm package was used for command line arguments?

A

yargs

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

What is hideBin?

A

Shorthand for process.argv.slice(2)

40
Q

What is the spread operator?

A

41
Q

What is the spread operator used for?

A

Array construction and de-structuring

42
Q

What is the difference between Promise.all and Promise.allSettled?

A

Promise.all stops execution if any promise is rejected, Promise.allSettled returns a status with each promise

43
Q

What is the difference between using await and then() for a promise?

A

then() requires a callback function

44
Q

How do you separate digits when writing big ints?

A

Underscores ( _ )

45
Q

What is the ranking of different loops?

A
  1. for
  2. forEach
  3. forOf
  4. map
46
Q

What npm package was used to load environment variables?

A

dotenv

47
Q

What file is used to store the environment variables?

A

.env

48
Q

What is MongoDB?

A

Document-oriented NoSQL database

49
Q

What is the equivalent of a primary key in MongoDB?

A

_id

50
Q

What is the equivalent of a table in MongoDB?

A

Collection

51
Q

What is the equivalent of a row in MongoDB?

A

Document

52
Q

What is the equivalent of a column in MongoDB?

A

Field

53
Q

What is IIFE?

A

Immediately Invoked Function Expressions

54
Q

What are the 2 parts of an IIFE?

A
  1. Anonymous function scoped in the Grouping operator
  2. ()
55
Q

How does Object.keys(obj).length work?

A

Iterates over keys to compute temporary array and return its length

56
Q

What JavaScript engine does MongoDB use?

A

SpiderMonkey

57
Q

What does Array.map(…) return?

A

A new array

58
Q

What 4 types of middleware can Express use?

A
  1. Application
  2. Error-handling
  3. Router-level
  4. Built-in
59
Q

What are the 3 built-in middleware functions in Express?

A
  1. express.static
  2. express.json
  3. express.urlencoded
60
Q

What are the 2 functions for application level middleware?

A
  1. app.use()
  2. app.METHOD()
    METHOD = GET, PUT, POST
61
Q

How do you declare a globally scoped variable?

A

var

62
Q

How do you declare a scoped variable?

A

let

63
Q

Which variable declaration type can be re-declared?

A

var

64
Q

What is Fastify?

A

Low-overhead server framework built on top of Node.js

65
Q

What is Mercurius?

A

An adapter for Fastify to communicate with GraphQL

66
Q

How does JavaScript pass primitive types?

A

By Value

67
Q

How does JavaScript pass NON primitive types?

A

By Reference

68
Q

How does JavaScript pass string types?

A

By Value

69
Q

What is MERN?

A

Mongo
Express
React
Node

70
Q

What stack are we using for the case study?

A

MFRN

71
Q

What library is used for developing React apps?

A

Vite

72
Q

How many node_modules folders are there in the case study?

A

2

73
Q

What version of React was used in the case study?

A

18.2.0

74
Q

What command starts the development server?

A

npm run dev

75
Q

What is Material Design?

A

A design language developed by Google

76
Q

What function would be used to sum all the numbers of an array?

A

reduce()

77
Q

What function is used to do an existence check on an array?

A

includes()

78
Q

What function is used to insert an element at the beginning of the array?

A

unshift()

79
Q

What function is used to convert an array to a string?

A

join()

80
Q

What is the starting point for a react application?

A

.render()

81
Q

What file has the job to render the React elements?

A

main.jsx

82
Q

What kind of react components do we focus on?

A

Functional

83
Q

How is the class HTML attribute in React?

A

className

84
Q

What 2 classes are extended to make a react class component?

A
  1. React.Component
  2. React.PureComponent
85
Q

What do react class components allow us to use out of the box?

A

state

86
Q

How do functional components utilize state?

A

Hooks

87
Q

What Material Design library was used for React?

A

Material-UI

88
Q

What is Functional Programming a a subset of?

A

Declarative Programming

89
Q

What is Object Oriented Programming a subset of?

A

Imperative Programming

90
Q

Which programming paradigm is more concerned with HOW?

A

Imperative Programming

91
Q

Which programming paradigm is more concerned with WHAT?

A

Declarative Programming

92
Q

What is CORS?

A

Cross Origin Resource Sharing

93
Q

What is a reducer?

A

A function that provides instructions for combining things

94
Q

What kind of hook allows lifecycle events?

A

useEffect

95
Q
A