Senior Side Flashcards
What is a code block? What are some examples of a code block?
denoted by braces.
function definitions
conditional blocks
loop blocks
What does block scope mean?
declaring a variable inside the code block
variables only exist inside that block
What is the scope of a variable declared with const or let?
block scope
What is the difference between let and const?
let variables can have values reassigned but the variable itself cannot be redeclared to another name. Const variables can’t be reassigned and redeclared.
Why is it possible to .push() a new value into a const variable that points to an Array?
only the reference cannot be changed but the value itself can be changed
How should you decide on which type of declaration to use?
if you are going to be reassigning the variable then use let and if not then use const
What is the syntax for writing a template literal?
backticks and any variable or expression inside ${}
What is “string interpolation”?
substitute an expression or variable into a template literal
What is destructuring, conceptually?
unpacking values from arrays and assigning them into variables
What is the syntax for Object destructuring?
variable declaration curly braces property keys equal sign and object being destructed
What is the syntax for Array destructuring?
variable declaration square brackets elements and array being destructured
How can you tell the difference between destructuring and creating Object/Array literals?
destructuring happens on the left side
creating happens on the right side
What is the syntax for defining an arrow function?
( => {} )
When an arrow function’s body is left without curly braces, what changes in its functionality?
doesn’t need a return keyword
implicit return
How is the value of this determined within an arrow function?
at definition time
What is a CLI?
command line interface
What is a GUI?
graphical user interface
Give at least one use case for each of the commands listed. man cat ls pwd echo touch mkdir mv rm cp
man - look at manual cat - concatenate files or print output ls - list directory contents pwd - print working directory echo - display line of text touch - change file timestamps mkdir - make directories mv - move (rename) files rm - remove files cp - copy files and directories
What are the three virtues of a great programmer?
laziness, anger, hubris
What is Node.js?
javascript environment where you can run code outside of the browser
What can Node.js be used for?
build back end for Web applications, command-line programs, or any kind of automation that developers wish to perform
What is a REPL?
Read–eval–print loop
reads input, evals input, and prints
When was Node.js created?
2009
What back end languages have you heard of?
Java, C, C++, Python, C#, Ruby