JS ES6 Flashcards

1
Q

What does block scope mean?

A

scope within a code block

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

What is the scope of a variable declared with const or let?

A

block scope

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

What is the difference between let and const?

A

let can be reassigned later

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

What is the syntax for writing a template literal?

A

backticks to surround the string and also ${} to surround javascript objects

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

What is destructuring, conceptually?

A

how you get properties or array elements all on one line

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

What is the syntax for Object destructuring?

A

const {s, t, u, f, f} = objName;

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

What is the syntax for Array destructuring?

A

const [index1, index2, indexX] = arrName;

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

How can you tell the difference between destructuring and creating Object/Array literals?

A

the curly braces or array braces will be on the left side of the equals sign

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

What is the syntax for defining an arrow function?

A

variable declaration if not inline, then parens with parameters

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

When an arrow function’s body is left without curly braces, what changes in its functionality?

A

it automatically has a return without braces

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

How is the value of this determined within an arrow function?

A

At definition time

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

man
cat
ls
pwd
echo
touch
mkdir
mv
rm
cp

A

man - manual
cat - concat files
ls - list dir contents
pwd - print dir
echo - display text
touch - change timestamp
mkdir - make directories
mv - rename a directory
rm - deletes
cp - copy files/dirs

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

What can Node.js be used for?

A

command line apps, automation, back-end servers

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

What is a REPL?

A

read, eval, print, loop

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

What is a REPL?

A

read, eval, print, loop

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

What is a REPL?

A

read, eval, print, loop

16
Q

What is the process object in a Node.js program?

A

information about the currently running process

17
Q

How do you access the process object in a Node.js program?

A

global object

18
Q

What is the data type of process.argv in Node.js?

A

object of strings