Object Flashcards

1
Q

Object.prototype.hasOwnProperty()

A

Determine whether the object has property as a direct property.

params: prop

Note: In contrast with in, this does not check down the property chain

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Object.getOwnPropertyNames()

A

Returns all property names (enum or not) that are direct properties

params: obj

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Object.assign()

A

Copy values of all enumerable own properties from source(s) to target object and return target object

params: target, …sources

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Object.create()

A

Create a new object with proto and properties

params: proto[, propertiesObject]

propertiesObject
an object with enum own properties specifying property descriptors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Object.defineProperties()

A

Defines new or modifies existing properties directly on object. Returns the object.

params: obj, props

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Object.defineProperty()

A

Define a new or modify an existing property directly on an object. Returns the object.

params: obj, prop, descriptor

obj
    the object to modify
prop
    the prop name 
descriptor
    An object with
 data descriptors:
      - configurable (required, defaults to false)
      - enumerable (required, defaults to false)
      - value
      - writable
    and accessor descriptors:
      - get
      - set
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Object.freeze()

A

Prevents new properties from being added, existing properties from being deleted or changed

params: obj

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Object.getOwnPropertyDescriptor()

A

Returns a property descriptor for an own property

params: obj, prop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Object.getOwnPropertyNames()

A

Returns an array of all own string properties (enum or not)

params: obj

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Object.getOwnPropertySymbols()

A

Returns as array of all own symbol properties

params: obj

How well did you know this?
1
Not at all
2
3
4
5
Perfectly