Midterm Flashcards
What was the original name for JavaScript?
LiveScript
What is the engine embedded in the browser called?
JavaScript Virtual Machine
What JavaScript engine runs in Chrome?
V8
What JavaScript engine runs in FireFox?
SpiderMonkey
Why is modern JavaScript known as a “safe” language?
No low-level access or memory or CPU
What are 3 great things about JavaScript?
- Full integration with HTML/CSS
- Simple things are done simply
- Supported by all major browsers and enabled by default
What does JSON stand for?
JavaScript Object Notation
What engine is Node.js built on?
V8
What is Node.js?
Cross-platform back-end JavaScript runtime environment
What are 5 main features of Node.js?
- Asynchronous and Event Driven
- Very Fast
- Single Threaded but highly scalable
- No buffering
- MIT License
When is it not advisable to use Node.js?
CPU intensive applications
What are the 5 best use-cases for Node.js?
- I/O bound applications
- Data Streaming apps
- DIRT
- JSON API based apps
- Single Page Apps
What is DIRT?
Data Intensive Real-time Applications
What character is used for Template Literals?
Backtick ( ` )
What 3 things can you do with a template literal?
- Multi-line strings
- String interpolation
- Tagged templates
How do you specify a placeholder in a template literal?
${ expression }
What is the difference between ES6 and ES2015?
They are synonyms
How long do Node.js versions enter Current release status?
6 months
What happens after a Node.js version ends current status?
Odd numbers become unsupported, even numbers enter Active LTS status
What is LTS status with Node.js?
Long-term support
What are 2 major benefits of arrow functions?
- Clean and concise syntax
- More intuitive scoping and “this” binding
Which version of Node are we using?
18
What is blocking code?
Execution of code pauses until read operation completes.
What is a callback function?
Any function passed as an argument to another function
What 2 parts does npm consist of?
- CLI tool
- Online repository
What 4 metadata are provided in the package.json
- name
- version
- description
- license
How do you create the package.json file?
npm init
How do you get around default node using CJS when considering modules?
In package.json add
“type” : “module”
What is a promise?
An object that holds the future value of an async operation
What are the 3 states of a promise?
- Pending
- Resolved
- Rejected
What 2 callback functions does a promise take?
- resolve
- reject
How do we consume a promise?
then() catch()
What does Promise.all take as input?
An array of promises
What is the rest operator?
…
What is the rest operator used for?
Used to pass a variable number of arguments to a function
In a list of parameters, which position must the rest operator be used?
Last
What is process.argv?
An array of command line arguments
What npm package was used for command line arguments?
yargs