fix(guide): simplify directory structure

This commit is contained in:
Mrugesh Mohapatra
2018-10-16 21:26:13 +05:30
parent f989c28c52
commit da0df12ab7
35752 changed files with 0 additions and 317652 deletions

View File

@ -0,0 +1,15 @@
---
title: Object
---
## Object
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@ -0,0 +1,62 @@
---
title: Object Assign
---
## Object Assign
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-assign/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
The `Object.assign()` method is used to 1) add properties and values to an existing object, 2) make a new copy of an existing object, or 3) combine multiple existing objects into a single object. The `Object.assign()` method requires one targetObject as a parameter and can accept an unlimited number of sourceObjects as additional parameters.
Important to note here is that the targetObject parameter will always be modified. If that parameter points to an existing object, then that object will be both modified and copied. If, however, you wish to create a copy of an object without modifying that original object, you can pass an empty object `{}` as the first (or targetObject) parameter and the object to be copied as the second (or sourceObject) parameter.
If objects passed as parameters into `Object.assign()` share the same properties (or keys), property values that come later in the parameters list will overwrite those which came earlier.
**Syntax**
```javascript
Object.assign(targetObject, ...sourceObject)
```
**Return Value**
`Object.assign()` returns the targetObject.
**Examples**
_Modifying and Copying targetObject_
```javascript
let obj = {name: 'Dave', age: 30};
let objCopy = Object.assign(obj, {coder: true});
console.log(obj); // returns { name: 'Dave', age: 30, coder: true }
console.log(objCopy); // returns { name: 'Dave', age: 30, coder: true }
```
_Copying targetObject Without Modification_
```javascript
let obj = {name: 'Dave', age: 30};
let objCopy = Object.assign({}, obj, {coder: true});
console.log(obj); // returns { name: 'Dave', age: 30 }
console.log(objCopy); // returns { name: 'Dave', age: 30, coder: true }
```
_Objects With Same Properties_
```javascript
let obj = {name: 'Dave', age: 30, favoriteColor: 'blue'};
let objCopy = Object.assign({}, obj, {coder: true, favoriteColor: 'red'});
console.log(obj); // returns { name: 'Dave', age: 30, favoriteColor: 'blue' }
console.log(objCopy); // { name: 'Dave', age: 30, favoriteColor: 'red', coder: true }
```
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign">MDN</a><br />
<a href="https://youtu.be/vM7Tif98Dlo">Intro to Object.assign in ES6 (Video)</a>

View File

@ -0,0 +1,15 @@
---
title: Object Create
---
## Object Create
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-create/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@ -0,0 +1,15 @@
---
title: Object defineProperties
---
## Object defineProperties
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-defineproperties/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@ -0,0 +1,15 @@
---
title: Object defineProperty
---
## Object defineProperty
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-defineproperty/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@ -0,0 +1,196 @@
---
title: Object Destructuring
---
# Object Destructuring
Destructuring is a convenient way of extracting multiple values from data stored in Objects. It can be used in locations that receive data (such as the left-hand side of an assignment). This feature is introduced in `ECMAScript 6`.
How to extract the values is specified via patterns (read on for examples).
### Basic assignment
```
var userInfo = {name: 'neel', age: 22};
var {name, age} = userInfo;
console.log(name); // neel
console.log(age); // 22
```
### Assignment without declaration
A variable can be assigned its value with destructuring separate from its declaration.
```
var name, age;
({name, age} = {name: 'neel', age: 22});
```
> The `( .. )` around the assignment statement is required syntax when using object literal destructuring assignment without a declaration.
> `{name, age} = {name: 'neel', age: 22}` is not valid stand-alone syntax, as the `{name, age}` on the left-hand side is considered a block and not an object literal.
> However, `({name, age} = {name: 'neel', age: 22})` is valid, as is `var {name, age} = {name: 'neel', age: 22}`
### Assigning to new variable names
A property can be unpacked from an object and assigned to a variable with a different name than the object property.
```
var userInfo = {a: 'neel', b: 22};
var {a: name, b: bar} = userInfo;
console.log(name); // neel
console.log(bar); // 22
```
### Default values
A variable can be assigned a default, in the case that the value unpacked from the object is `undefined`.
```
var {name = 'ananonumys', age = 20} = {name: 'neel'};
console.log(name); // neel
console.log(age); // 20
```
### Assigning to new variables names and providing default values
A property can be both
1. unpacked from an object and assigned to a variable with a different name and
2. assigned a default value in case the unpacked value is `undefined`.
```
var {a:name = 'ananonumys', b:age = 20} = {age: 22};
console.log(name); // ananonumys
console.log(age); // 22
```
### Setting a function parameter's default value
#### ES5 version
```
function getUserInfo(data) {
data = data === undefined ? {} : data;
var name = data.name === undefined ? 'ananonumys' : data.name;
var age = data.age === undefined ? 20 : data.age;
var location = data.location === undefined ? 'india' : data.location;
console.log(name, age, location);
// print user data
}
getUserInfo({
name: 'neel',
age: 22,
location: 'canada'
});
```
#### ES2015 version
```
function getUserInfo({name = 'ananonumys', age = 20, location = 'india'} = {}) {
console.log(name, age, location);
// print user data
}
getUserInfo({
name: 'neel',
age: 22,
location: 'canada'
});
```
> In the function signature for `getUserInfo` above, the destructured left-hand side is assigned to an empty object literal on the right-hand side: `{name = 'ananonumys', age = 20, location = 'india'} = {}`. You could have also written the function without the right-hand side assignment. However, if you leave out the right-hand side assignment, the function will look for at least one argument to be supplied when invoked, whereas in its current form, you can simply call `getUserInfo()` without supplying any parameters. The current design is useful if you want to be able to call the function without supplying any parameters, the other can be useful when you want to ensure an object is passed to the function.
### Nested object and array destructuring
```
var metadata = {
title: 'Scratchpad',
translations: [
{
locale: 'de',
localization_tags: [],
last_edit: '2014-04-14T08:43:37',
url: '/de/docs/Tools/Scratchpad',
title: 'JavaScript-Umgebung'
}
],
url: '/en-US/docs/Tools/Scratchpad'
};
var {title: englishTitle, translations: [{title: localeTitle}]} = metadata;
console.log(englishTitle); // "Scratchpad"
console.log(localeTitle); // "JavaScript-Umgebung"
```
### For of iteration and destructuring
```
var people = [
{
name: 'Mike Smith',
family: {
mother: 'Jane Smith',
father: 'Harry Smith',
sister: 'Samantha Smith'
},
age: 35
},
{
name: 'Tom Jones',
family: {
mother: 'Norah Jones',
father: 'Richard Jones',
brother: 'Howard Jones'
},
age: 25
}
];
for (var {name: n, family: {father: f}} of people) {
console.log('Name: ' + n + ', Father: ' + f);
}
// "Name: Mike Smith, Father: Harry Smith"
// "Name: Tom Jones, Father: Richard Jones"
```
### Unpacking fields from objects passed as function parameter
```
function userId({id}) {
return id;
}
function whois({displayName, fullName: {firstName: name}}) {
console.log(displayName + ' is ' + name);
}
var user = {
id: 42,
displayName: 'jdoe',
fullName: {
firstName: 'John',
lastName: 'Doe'
}
};
console.log('userId: ' + userId(user)); // "userId: 42"
whois(user); // "jdoe is John"
```
This unpacks the `id`, `displayName` and `firstName` from the user object and prints them.
### Computed object property names and destructuring
```
let key = 'z';
let {[key]: foo} = {z: 'bar'};
console.log(foo); // "bar"
```
See also: <a>**Object Destructuring**</a> | <a href='https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#Object_destructuring' target='_blank' rel='nofollow'>MDN</a>

View File

@ -0,0 +1,15 @@
---
title: Object Entries
---
## Object Entries
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-entries/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@ -0,0 +1,60 @@
---
title: Object Freeze
---
## Object Freeze
The `Object.freeze()` method freezes an object. A frozen object will *prevent you* from:
* Adding new properties to it
* Removing existing proprerties from it
* Changing the enumerability, configurability, or writeability of it's existing properties
### Syntax
```javascript
Object.freeze(obj)
```
### Parameters
`obj`
* The object to freeze.
### Returns
The frozen object.
### Important Note
Attempting to add, remove, or modify properties of a frozen object will result in a failure. This failure will either be silent or a thrown `TypeError` (if Strict Mode is enabled). Additionally, `Object.freeze()` is a shallow operation. This means that nested object, of a frozen object, are modifiable.
### Example
```javascript
// Create your object
let person = {
name: 'Johnny',
age: 23,
guild: 'Army of Darkness',
hobbies: ['music', 'gaming', 'rock climbing']
}
// Modify your object
person.name = 'John'
person.age = 24
person.hobbies.splice(1,1)
delete person.guild
// Verify your object has been modified
console.log(person) // { name: 'John', age: 24, hobbies: ['music', 'rock climbing']
// Freeze your object
Object.freeze(person)
// Verify that your object can no longer be modified
person.name = 'Johnny' // fails silently
person.age = 23 // fails silently
console.log(person) // { name: 'John', age: 24, hobbies: ['music', 'rock climbing']
// The freeze is "shallow" and nested objects (including arrays) can still be modified
person.hobbies.push('basketball')
consol.log(person.hobbies) // ['music', 'rock climbing', 'basketball']
```
#### More Information:
[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze)

View File

@ -0,0 +1,15 @@
---
title: Object getOwnPropertyDescriptor
---
## Object getOwnPropertyDescriptor
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-getownpropertydescriptor/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@ -0,0 +1,15 @@
---
title: Object getOwnPropertyDescriptors
---
## Object getOwnPropertyDescriptors
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-getownpropertydescriptors/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@ -0,0 +1,71 @@
---
title: Object getOwnPropertyNames
---
The `Object.getOwnPropertyNames()` method returns an array of all properties (enumerable or not) found directly upon a given object.
## Syntax
Object.getOwnPropertyNames(obj)
### Parameters
**obj**
The object whose enumerable _and non-enumerable_ own properties are to be returned.
<a href='https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames' target='_blank' rel='nofollow'>MDN link</a> | <a href='https://msdn.microsoft.com/en-us/LIBRary/ff688126%28v=vs.94%29.aspx' target='_blank' rel='nofollow'>MSDN link</a>
## Description
`Object.getOwnPropertyNames()` returns an array whose elements are strings corresponding to the enumerable _and non-enumerable_ properties found directly upon object. The ordering of the enumerable properties in the array is consistent with the ordering exposed by a `for...in` loop (or by `Object.keys()`) over the properties of the object. The ordering of the non-enumerable properties in the array, and among the enumerable properties, is not defined.
## Examples
var arr = ['a', 'b', 'c'];
console.log(Object.getOwnPropertyNames(arr).sort()); // logs '0,1,2,length'
// Array-like object
var obj = { 0: 'a', 1: 'b', 2: 'c' };
console.log(Object.getOwnPropertyNames(obj).sort()); // logs '0,1,2'
// Logging property names and values using Array.forEach
Object.getOwnPropertyNames(obj).forEach(function(val, idx, array) {
console.log(val + ' -> ' + obj[val]);
});
// logs
// 0 -> a
// 1 -> b
// 2 -> c
// non-enumerable property
var my_obj = Object.create({}, {
getFoo: {
value: function() { return this.foo; },
enumerable: false
}
});
my_obj.foo = 1;
console.log(Object.getOwnPropertyNames(my_obj).sort()); // logs 'foo,getFoo'
function Pasta(grain, size, shape) {
this.grain = grain;
this.size = size;
this.shape = shape;
}
var spaghetti = new Pasta("wheat", 2, "circle");
var names = Object.getOwnPropertyNames(spaghetti).filter(CheckKey);
document.write(names);
// Check whether the first character of a string is 's'.
function CheckKey(value) {
var firstChar = value.substr(0, 1);
if (firstChar.toLowerCase() == 's')
return true;
else
return false;
}
// Output:
// size,shape

View File

@ -0,0 +1,15 @@
---
title: Object getOwnPropertySymbols
---
## Object getOwnPropertySymbols
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-getownpropertysymbols/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@ -0,0 +1,15 @@
---
title: Object.prototype.get.prototype.of
---
## Object.prototype.get.prototype.of
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-getprototypeof/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@ -0,0 +1,69 @@
---
title: Object Is
---
# Object Is
## Description
The ```object.is()``` method is used to determine if two values are the same value. This method was introduced in ES6.
## Syntax
```Object.is(val1, val2)```
### Parameters
**val1** - first value to compare
**val2** - second value to compare
## Return value
A [Boolean](https://guide.freecodecamp.org/javascript/booleans) indicating whether the two arguments have the same value
## Description
```Object.is()``` compares two values for sameness, returning ```true``` if both values meet one of the following conditions:
* ```undefined```
* ```null```
* Both ```true``` or both ```false```
* String of the same length and same characters
* Same object
* Both numbers and:
* Both ```+0``` or both ```-0```
* Both ```NaN```
* or both a number that is not zero and not ```NaN```
## Examples
```
Object.is('string', 'string'); // true
Object.is(undefined, undefined); // true
Object.is(null, null); // true
Object.is('string, 'word'); // false
Object.is(true, false); // false
Object.is([], []); //false
var obj = {name: Jane};
Object.is(obj, obj); // true
Object.is(NaN, NaN); // true
Object.is(+0, -0); // false
Object.is(-0, -0); // true
```
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->
[Object.is() MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)
<br>
[Strict equality operator ```===```](https://guide.freecodecamp.org/certificates/comparison-with-the-strict-equality-operator)

View File

@ -0,0 +1,15 @@
---
title: Object isExtensible
---
## Object isExtensible
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-isextensible/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@ -0,0 +1,40 @@
---
title: Object isFrozen
---
## Object isFrozen
You can use <b>`Object.isFrozen()`</b> to figure out if an object is frozen or not. It returns a <b>`true`</b> or <b>`false`</b> boolean value.
<b><h4>SYNTAX</h4></b>
```javascript
Object.isFrozen(obj)
```
<b>For Example:</b>
```javascript
var foods = {
grain : "wheat",
dairy : "milk",
vegetable : "carrot",
fruit : "grape"
};
var frozenFoods = Object.freeze(foods);
var areMyFoodsFrozen = Object.isFrozen(frozenFoods);
\\ returns true
```
Remember, a frozen object <b>cannot</b> have its properties changed.
</br></br>
If you try to use <b>`Object.isFrozen()`</b> on a non-object argument, it will return `true`.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->
<a href='https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen' target='_blank' rel='nofollow'>MDN Object.isFrozen()</a></br>
<a href='https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze' target='_blank' rel='nofollow'>MDN Object.freeze()</a>

View File

@ -0,0 +1,15 @@
---
title: Object Issealed
---
## Object Issealed
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-issealed/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@ -0,0 +1,61 @@
---
title: Object Keys
---
The `Object.keys()` method returns an array of a given object's own enumerable properties, in the same order as that provided by a `for...in` loop (the difference being that a `for-in` loop enumerates properties in the prototype chain as well).
## Syntax
Object.keys(obj)
### Parameters
**obj**
The object whose enumerable own properties are to be returned.
<a href='https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys' target='_blank' rel='nofollow'>MDN link</a> | <a href='https://msdn.microsoft.com/en-us/LIBRary/ff688127%28v=vs.94%29.aspx' target='_blank' rel='nofollow'>MSDN link</a>
## Description
`Object.keys()` returns an array whose elements are strings corresponding to the enumerable properties found directly upon object. The ordering of the properties is the same as that given by looping over the properties of the object manually.
## Examples
var arr = ['a', 'b', 'c'];
console.log(Object.keys(arr)); // console: ['0', '1', '2']
// array like object
var obj = { 0: 'a', 1: 'b', 2: 'c' };
console.log(Object.keys(obj)); // console: ['0', '1', '2']
// array like object with random key ordering
var an_obj = { 100: 'a', 2: 'b', 7: 'c' };
console.log(Object.keys(an_obj)); // console: ['2', '7', '100']
// getFoo is property which isn't enumerable
var my_obj = Object.create({}, { getFoo: { value: function() { return this.foo; } } });
my_obj.foo = 1;
console.log(Object.keys(my_obj)); // console: ['foo']
// Create a constructor function.
function Pasta(grain, width, shape) {
this.grain = grain;
this.width = width;
this.shape = shape;
// Define a method.
this.toString = function () {
return (this.grain + ", " + this.width + ", " + this.shape);
}
}
// Create an object.
var spaghetti = new Pasta("wheat", 0.2, "circle");
// Put the enumerable properties and methods of the object in an array.
var arr = Object.keys(spaghetti);
document.write (arr);
// Output:
// grain,width,shape,toString

View File

@ -0,0 +1,15 @@
---
title: Object preventExtensions
---
## Object preventExtensions
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-preventextentions/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@ -0,0 +1,15 @@
---
title: Object.prototype.__defineGetter__
---
## Object.prototype.__defineGetter__
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-prototype-__definegetter__/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@ -0,0 +1,15 @@
---
title: Object.prototype.__defineSetter__
---
## Object.prototype.__defineSetter__
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-prototype-__definesetter__/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@ -0,0 +1,50 @@
---
title: Object.prototype.hasOwnProperty
---
## Object.prototype.hasOwnProperty
### Syntax
`Object.hasOwnProperty(prop)`
### Description
The **hasOwnProperty()** method returns a <a href='https://developer.mozilla.org/en-US/docs/Glossary/Boolean' target='_blank' rel='nofollow'>boolean</a> indicating if the object owns the specified property.
This is a convenient method to check if an object has the specified property or not; returning true/false accordingly.
### Parameters
##### prop
A <a href='https://developer.mozilla.org/en-US/docs/Glossary/String' target='_blank' rel='nofollow'>string</a> or <a href='https://developer.mozilla.org/en-US/docs/Glossary/Symbol' target='_blank' rel='nofollow'>symbol</a> to test.
### Examples
using **hasOwnProperty()** to test if a property exist or not in a given object:
```js
var course = {
name: 'freeCodeCamp',
feature: 'is awesome',
}
var student = {
name: 'enthusiastic student',
}
course.hasOwnProperty('name'); // returns true
course.hasOwnProperty('feature'); // returns true
student.hasOwnProperty('name'); // returns true
student.hasOwnProperty('feature'); // returns false
```
#### links
<a href='https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty' target='_blank' rel='nofollow'>MDN hasOwnProperty</a>

View File

@ -0,0 +1,15 @@
---
title: Object.prototype.is.prototype.of
---
## Object.prototype.is.prototype.of
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-prototype-isprototypeof/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@ -0,0 +1,15 @@
---
title: Object.prototype.__lookupGetter__
---
## Object.prototype.__lookupGetter__
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-prototype-__lookupgetter__/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@ -0,0 +1,15 @@
---
title: Object.prototype.__lookupSetter__
---
## Object.prototype.__lookupSetter__
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-prototype-__lookupsetter__/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@ -0,0 +1,15 @@
---
title: Object.prototype.propertyIsEnumerable
---
## Object.prototype.propertyIsEnumerable
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-prototype-propertyisenumerable/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@ -0,0 +1,15 @@
---
title: Object.prototype.set.prototype.of
---
## Object.prototype.set.prototype.of
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-prototype-setprototypeof/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@ -0,0 +1,15 @@
---
title: Object.prototype.tolocalstring
---
## Object.prototype.tolocalstring
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-prototype-tolocalstring/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@ -0,0 +1,15 @@
---
title: Object.prototype.toSource
---
## Object.prototype.toSource
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-prototype-tosource/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@ -0,0 +1,15 @@
---
title: Object.prototype.toString
---
## Object.prototype.toString
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-prototype-tostring/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@ -0,0 +1,15 @@
---
title: Object.prototype.unwatch
---
## Object.prototype.unwatch
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-prototype-unwatch/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@ -0,0 +1,15 @@
---
title: Object.prototype.valueOf
---
## Object.prototype.valueOf
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-prototype-valueof/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@ -0,0 +1,15 @@
---
title: Object.prototype.watch
---
## Object.prototype.watch
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-prototype-watch/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@ -0,0 +1,15 @@
---
title: Object Prototype.constructor
---
## Object Prototype.constructor
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-prototype.constructor/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@ -0,0 +1,15 @@
---
title: Object Seal
---
## Object Seal
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-seal/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@ -0,0 +1,15 @@
---
title: Object.prototype.set.prototype.of
---
## Object.prototype.set.prototype.of
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-setprototypeof/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->

View File

@ -0,0 +1,45 @@
---
title: Object Values
---
The `Object.values()` method returns an array of a given object's own enumerable property values, in the same order as that provided by a for...in loop (the difference being that a for-in loop enumerates properties in the prototype chain as well).
## Syntax
Object.values(obj)
### Parameters
**obj**
The object whose enumerable own properties are to be returned.
<a href='https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/values' target='_blank' rel='nofollow'>MDN link</a>
## Description
`Object.values()` returns an array whose elements are the enumerable property values found on the object. The ordering of the properties is the same as that given by looping over the property values of the object manually. In other words, an object has key:value pairs, and this method returns all the *values* of that object in an array-like object.
See [Object.keys](https://guide.freecodecamp.org/javascript/standard-objects/object/object-keys/), which returns all the *keys* of that object in an array-like object.
## Examples
var obj = { foo: 'bar', baz: 42 };
console.log(Object.values(obj)); // ['bar', 42]
// array like object
var obj = { 0: 'a', 1: 'b', 2: 'c' };
console.log(Object.values(obj)); // ['a', 'b', 'c']
// array like object with random key ordering
var an_obj = { 100: 'a', 2: 'b', 7: 'c' };
console.log(Object.values(an_obj)); // ['b', 'c', 'a']
// getFoo is property which isn't enumerable
var my_obj = Object.create({}, { getFoo: { value: function() { return this.foo; } } });
my_obj.foo = 'bar';
console.log(Object.values(my_obj)); // ['bar']
// non-object argument will be coerced to an object
console.log(Object.values('foo')); // ['f', 'o', 'o']
**doesn't work in Internet Explorer*