Senior Side Flashcards
(114 cards)
What is a code block? What are some examples of a code block?
{ } ; functions, loops, conditionals
What does block scope mean?
only variables within the block are avalible to use
What is the scope of a variable declared with const or let?
block scope
What is the difference between let and const?
let can be reassigned; const cannot
Why is it possible to .push() a new value into a const variable that points to an Array?
Since the value of const is still the same array just changing the contents within
How should you decide on which type of declaration to use?
Use const first then decide if let it needed
What is destructuring, conceptually?
unpack values from array/properties into distinct variables
What is the syntax for Object destructuring?
const/let {propKeys: (new name) = objectName (from which object) }
What is the syntax for Array destructuring?
const/let [propKeys: (new name) = arrayName (from which array) ]
How can you tell the difference between destructuring and creating Object/Array literals?
Which side is the = on
What is the syntax for writing a template literal?
use ` ` and ${ } for variables (instead of concatenation)
What is “string interpolation”?
Using ${ } for variables
What is the syntax for defining an arrow function?
(parameters) => { } OR () => {}
When an arrow function’s body is left without curly braces, what changes in its functionality?
Automatically returns expression
How is the value of this determined within an arrow function?
enclosing scope; defined w/in function definition (usually at function call)
What is Node.js?
asynchronous event driven JS routine; executes JS outside the browser
What can Node.js be used for?
designed to build scalable network apps (command / http servers/clients)
What is a REPL?
Read-Event-Print loop
When was Node.js created?
2009
What is a CLI?
Command Line Interface
What is a GUI?
graphical user interface
What does the “man” command do?
the manual for other commands
What does the “cat” command do?
reads the file and can combine files
ls command?
list directory contents (-a for all -classify)