Senior Side Flashcards
What is a code block? What are some examples of a code block?
is code contained within { }. If else, for, while, function code blocks, etc
What does block scope mean?
variable defined exclusively within a block and cannot be accessed from outside the block
What is the scope of a variable declared withconstorlet?
block scope
What is the difference betweenletandconst?
let: is similar to var in that the value can be reassigned.
const: can not be reassigned and cannot be redeclared within the same scope
Why is it possible to.push()a new value into aconstvariable that points to anArray?
because you aren’t reassigning a variable you are adding to it, essentially you are telling it to store more information.
How should you decide on which type of declaration to use?
if the variable can be reassigned use let, if the variable is something that you may not want to change and will be reused to avoid accidentally reassigning that variable use const
What is the syntax for writing a template literal?
back ${variable} ticks
What is “string interpolation”?
the ability to substitute part of the string for the values of variables or expressions.
What is the syntax for defining an arrow function?
() optional parameters => optional {} expression to return
When an arrow function’s body is left without curly braces, what changes in its functionality?
it has a implicit return expression (can’t have any statements)
How is the value ofthisdetermined within an arrow function?
The value of this in an arrow function is determined when the arrow function is being defined.
What is a GUI?
Graphical User Interface
is a form ofuser interfacethat allowsuserstointeract with electronic devicesthrough graphicaliconsand audio indicator such as primary notation, instead oftext-based user interfaces, typed command labels or text navigation.
Give at least one use case for each of the commands:
man cat ls pwd echo touch mkdir mv rm cp
man (manual)
cat (concatenate files and print on the standard output)
Ls (list directory contents)
pwd (print name of current/working directory)
echo (display a line of text)
touch (create file, change file timestamps)
mkdir (make directories)
mv (move (rename) files)
rm (remove files or directories)
cp (copy files and directories)
What are the three virtues of a great programmer?
laziness, impatience, hubris
What is Node.js?
Node.js is a program that allows JavaScript to be run outside of a web browser.
What can Node.js be used for?
It is commonly used to build back ends for Web applications, command-line programs, or any kind of automation that developers wish to perform.
What is a REPL?
read–eval–print loop
also termed aninteractive toplevelorlanguage shell, is a simple interactivecomputer programmingenvironment that takes single user inputs, executes them, and returns the result to the user; a program written in a REPL environment is executed piecewise.
When was Node.js created?
May 27th, 2009
What back end languages have you heard of?
Python Php Ruby Java c++ c# Rust Golang Perl Visual basic Elixir Haskell C Clojure Kotlin Wasm
What is theprocessobject in a Node.js program?
global variable that provides information about node
How do you access theprocessobject in a Node.js program?
console.log(process)
What is the data type ofprocess.argvin Node.js?
array of strings
What is a JavaScript module?
its a single JavaScript file
What values are passed into a Node.js module’s local scope?
__dirname : The directory name of the current module.
__filename : The file name of the current module.
exports : A reference to themodule.exportsthat is shorter to type.
module : A reference to the current module
require() : idmodule name or path
Returns:exported module content
Used to import modules,JSON, and local files.