Section 1

Preview this deck

List all of the possible states of a promise

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (22)

Section 1

(22 cards)

List all of the possible states of a promise

Front

fulfilled, rejected, or pending

Back

command line arguments

Front

The process.argv property can be used to get all the ___.

Back

foods.yummies.candy

Front

The file foods.js contains the code shown below. How would snickers be referenced in another file that had imported foods.js into the variable foods? var yummies = { candy: "snickers", soda: "pepsi", chips: "lays" } module.exports = { yummies: yummies }

Back

Javascript Object Prototype

Front

All JavaScript objects inherit properties and methods from a prototype.

Back

How many possible states can a promise be in?

Front

3

Back

What is a Javascript Primitive data type?

Front

A primitive data type is data that has a primitive value.

Back

['i', 'love', 'coding']

Front

The contents of the file data.txt are i,love,coding. What will be the output of the code below? var fs = require("fs"); fs.readFile("data.txt", "utf8", function(err, data) { var output = data.split(","); console.log(output); });

Back

Every object has a ...

Front

prototype (each prototype has it's own prototype, and on to infinite)

Back

What is a promise?

Front

A promise is an object that may produce a single value some time in the future: either a resolved value, or a reason that it's not resolved (e.g., a network error occurred)

Back

a number

Front

The parseFloat and parseInt JavaScript functions can be used to parse an argument into ___.

Back

How many Javascript primitive data types are there?

Front

5: string number boolean null undefined

Back

What is a factory function?

Front

Back

What is a Javascript Primitive value?

Front

A primitive value is a value that has no properties or methods.

Back

How would you store something for a long time?

Front

Write it to a file (fs.write)

Back

require

Front

When writing JavaScript files that use Node, we can bring in code exported from another file using the ___ keyword.

Back

the package.json file

Front

Any NPM packages that an application is dependent on should be listed in ___.

Back

Node is also

Front

a run-time environment that runs Javascript OUTSIDE of the browser

Back

Finally, Node allows developers...

Front

to build web-servers, stand-alone desktop apps, phone apps (check out Electron)

Back

What is in object in Javascript?

Front

In JavaScript, almost "everything" is an object. Booleans can be objects (if defined with the new keyword) Numbers can be objects (if defined with the new keyword) Strings can be objects (if defined with the new keyword) Dates are always objects Maths are always objects Regular expressions are always objects Arrays are always objects Functions are always objects Objects are always objects All JavaScript values, except primitives, are objects.

Back

What 5 thins does 'new' operator do?

Front

1) It creates a new object. The type of this object is simply object. 2) It sets this new object's internal, inaccessible, [[prototype]] (i.e. __proto__) property to be the constructor function's external, accessible, prototype object (every function object automatically has a prototype property). 3) It makes the this variable point to the newly created object. 4) It executes the constructor function, using the newly created object whenever this is mentioned. 5) It returns the newly created object, unless the constructor function returns a non-null object reference. In this case, that object reference is returned instead.

Back

Node

Front

Runs javascript; terminal; server-size

Back

asynchronous

Front

Node uses ___ threading which allows the server to handle all requests using a single thread through event-based callbacks.

Back