Node and The Senior Side Flashcards
What is a code block? What are some examples of a code block?
In JavaScript, blocks are denoted by curly braces {} , for example, the if else, for, do while, while, try catch and etc.
What does block scope mean?
The context in which values and expressions are “visible” or can be referenced. If a variable or other expression is not “in the current scope,” then it is unavailable for use.
What is the scope of a variable declared with const or let?
let and const are blocked-scope,
What is the difference between let and const?
const is immutable, use it if you don’t plan on reassigning that variable
Why is it possible to .push() a new value into a const variable that points to an Array?
The const keyword ensures that the variable it creates is read-only. However, it doesn’t mean that the actual value to which the const variable reference is immutable. However, you cannot reassign a different value to the person constant like this. you’re not changing memory address.
How should you decide on which type of declaration to use?
If you plan on re-using it or not.
What is the syntax for writing a template literal?
Using a backtick character, which will produce a new string
What is “string interpolation”?
String formatting: the ability to substitute part of the string for the values of variables or expressions.
What is destructuring, conceptually?
The destructuring assignment syntax is a JavaScript expression that makes it possible to unpack values from arrays, or properties from objects, into distinct variables.
What is the syntax for Object destructuring?
declare a variable, have open curly braces, if necessary, give a property name, but you can be concise and reference the property.
What is the syntax for Array destructuring?
a variable with open brackets, and more variables within the brackets being = array variable name. order matters
How can you tell the difference between destructuring and creating Object/Array literals?
The Order of assignment
What is the syntax for defining an arrow function?
A variable with a name with an assignment operator with an arrow function with a parameter and then curly braces
When an arrow function’s body is left without curly braces, what changes in its functionality?
it expects one expression and automatically returns that expression. implicit means implied.
How is the value of this determined within an arrow function?
Arrow functions have a lexical this and its value within the arrow function is determined by the surrounding scope.
Where the function is defined… where as previous it was call time.
What is a CLI?
Command-line-interface, processes commands via lines of text
What is a GUI?
Graphic user interface, aimed at consumers of technology
Use Case for Man
Man displays the on-line manual pages, you can specify sections with it.
Use case for Cat
reads files sequentially, writing them to the standard output. in the exercise we could read a text file
Use case for ls
list directory contents
use case for pwd
writes absolute path name
use case for echo
write arguments to the standard output. we wrote a string, console log for console
use case for touch
Change file access and modify items, create file
use case for mkdir
make directories
use case for mv
move files or rename them
use case for rmman
remove directory files or directory with -r
Use case for cp
copy files or directories with -r
What are the three virtues of a great programmer?
laziness, impatience, and hubris
What is node.js
Allows to run javaScript outside the browser, commonly used to build back ends for web browsers, command-line programs, or any kind of automation that developers wish to perform.
What can Node.js be used for?
Node.js is designed to build scalable network applications, web application s that seamlessly and efficiently accommodate growth, and be designed with scalability in mind. Node.js can be used for everything, don’t
What is a REPL?
Stands for, Read–eval–print loop, and it takes single user inputs, executes them, and returns the result to the user
When was Node.js created?
2009,
What back end languages have you heard of?
python, java, sql, javascript, ruby, Go, C++, C#, Rust, F#
What is a computer process?
is the instance of a computer program that is being executed by one or many threads. It contains the program code and its activity.
A compute instance can be software or hardware which can run code, for example a CPU, GPU or a virtual machine
Roughly how many computer processes are running on your host operating system (Task Manager or Activity Monitor)?
365
Why should a full stack Web developer know that computer processes exist?
Because if it’s extremely demanding, nobody will use your stuff. Plus the better optimized it is, the more people can use it.
What is the process object in a Node.js program?
global that provides information about, and control over, the current Node.js process.
How do you access the process object in a Node.js program?
you can explicity get it through require
What is the data type of process.argv in Node.js?
array
What is a JavaScript module?
a file containing related code
What values are passed into a Node.js module’s local scope?
exports, module, the five