ES6 Flashcards
What is a code block? What are some examples of a code block?
code written inside the bracket {}
function bodys
loops
conditional
What does block scope mean?
something only existing inside the block
What is the scope of a variable declared with const or let?
block scope
What is the difference between let and const?
let variable can be reassigned const cant be reassigned
Why is it possible to .push() a new value into a const variable that points to an Array?
the const variable, in this case, an array, itself is immutable; on the other hand, the array itself is mutable - meaning, you can add new things to the array; think reassignment
What is the syntax for writing a template literal?
` `
What is the syntax for writing a template literal?
${expression}
What is “string interpolation”?
the ability to substitute part of the string for the values of variables or expressions.
What is destructuring conceptually?
takes values from arrays, or properties from objects, into distinct variables.
What is the syntax for Object destructuring?
const or let {propertyname} = object
What is the syntax for Array destructuring?
const or let or var [variable name ] = array
How can you tell the difference between destructuring and creating Object/Array literals?
if the array or object is on the left side then it destructuring
What is the syntax for defining an arrow function?
var keyword function = arguements => expresion let func = (arg1, arg2, ..., argN) => expression
When an arrow function’s body is left without curly braces, what changes in its functionality?
you can only have 1 line of code no curly braces no return keyword and it has to be an expression
How is the value of this determined within an arrow function?
based on the code block where the method is called
this is determined by call time based on its parents cod block
What is a CLI?
command line interface
What is a GUI?
graphical line interface
Give at least one use case for each of the commands listed in this exercise. man cat ls pwd echo touch mkdir mv rm cp
man is the manual
cat is when you want to add more than 1 file together
ls list directory contents
pwd returns working directory name
echo write arguments to the standard output
touch changes file access and modification times
mkdir makes directories
mv moves files or renames
rm removes files
cp makes a copy of the files
What are the three virtues of a great programmer?
laziness, impatience, and hubris.
What is Node.js?
a program that allows JavaScript in to be run outside of a web browser
What can Node.js be used for?
To build back ends for Web applications, command-line programs or any automation for devs to use
What is a REPL?
It is a quick and easy way to test simple Node.js/JavaScript code
When was Node.js created?
May 27, 2009
What back end languages have you heard of?
C# Java JS C++ Go VBA PHP Ruby Python Rust Haskell Pascal Perl Lisp C Clojure Rust Objective-C Swift Kotlin Julia Haskell Pas