Section 1

Preview this deck

How to list properties of an object

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 (32)

Section 1

(32 cards)

How to list properties of an object

Front

Object.keys(obj) or for (var key in obj) { if(obj.hasOwnProperty(key){} } hasOwnProperty check that the property wasn't inherited.

Back

Hoisting

Front

Refers to JavaScripts automated action of declaring variables at the top of their scope.

Back

.reduce()

Front

Provides a single output from an array where every element has been altered to define the final result. arr.reduce((result, elem = > result = result + elem)

Back

const

Front

Declaration of a variable with block scoping that cannot be reassigned.

Back

this

Front

The context of the code being written referred to as `this`.

Back

== vs ===

Front

== is a value check ('1' == 1) === is a value and type check (1 === 1)

Back

apply()

Front

Calls a function with a given context and arguments as an array. Ex. func.call(context, [arg1, arg2]

Back

XML

Front

Extensible Markup Language, a way of writing data in a tree-structured form by enclosing it in tags.

Back

JavaScript Scope

Front

The accessibility of variables. Functions create new scopes. There are two types: local and global.

Back

What are the components of a URL?

Front

http://video.google.com:80/videoplay?docid=123&h=hi#title Protocol: http:// Subdomain: video domain name: google.com port: :80 path: /videoplay query: ? Parameters: docid=123&h=hi fragment: title

Back

Currying

Front

The processing of converting a function with multiple arguments to a series of functions that take one argument. func(a)(b)(c)

Back

Falsy

Front

Outputs as false. There are 6 values: The boolean value false Zero An empty string null undefined NaN

Back

Memoizing

Front

A method for optimizing JS recursive functions by caching their results as they are called.

Back

Abstract Class vs Interface

Front

An abstract class is a class that is not implemented directly, containing one or more abstract methods, or methods that are not yet implemented. An interface can have only abstract methods, with a caveat in default methods. They are not close enough entities to classes to be thought of as one-- they exist primarily to describe a set of functions that a class that is said to be of that interface should have. (cars should accelerate, brake, and change gears, but you would never say that a car is a child of brakes). An important feature of interfaces is that multiple can be implemented by a class, as opposed to the option of extending a single abstract class.

Back

Parts of an Object

Front

Members: elements of an object Method: function member Property: variable member

Back

Function declaration vs expression

Front

Declaration: function written using the "function" naming convention. Will be hoisted. Expression: function written anonymously or as a variable. Will not be hoisted.

Back

static functions

Front

Methods in a class that can only be called on the class instead of a class instance. They are usually used for creating or cloning objects.

Back

.filter()

Front

Creates a new array from an existing array where each element meets a given set of requirements. arr.filter(elem => elem < 5)

Back

bind()

Front

It creates a duplicate function where you can bind the desired context.

Back

var

Front

Declaration of a variable with function scoping.

Back

Cloning arrays

Front

For shallow: spread operator ([...arr]) Loops .slice() For deep: JSON stringify then JSON parse

Back

Call stack

Front

Last In First Out

Back

Calling promises in sequence

Front

Chain callback functions to the first promise. Ex. prom1() .then(prom2()) .then(prom3())

Back

DOM

Front

Document Object Model A tree of objects that makes up of the content, structure, and style of a document.

Back

.map()

Front

Creates a new function out of an array where every element has been changed programatically. arr.map(elem => elem + 1)

Back

AJAX

Front

Asynchronous JavaScript and XML A method of transferring data between a website without refreshing or redirecting the page

Back

let

Front

Declaration of a variable with block scoping.

Back

Arrow function

Front

An es6 method for declaring functions. An arrow function lexically binds to their context rather than building its own. Ex. () => {} value => {} (value1, value2) => do something

Back

call()

Front

Calls a function with a given context and individually passed arguments. Ex. func.call(context, arg1, arg2)

Back

Truthly

Front

Outputs as true. Examples: Any non-zero number Any non-empty string The boolean value true An object An array

Back

Inheritance

Front

JS structures are all object based with a prototype that is used to define its parent object classification. With es6, classes can inherit other classes using "extends"

Back

Calling promises in parallel

Front

Call promise functions with their own separate callback functions. prom1().then() prom2().then()

Back