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,11 @@
---
title: Object
localeTitle: 宾语
---
## 目的
这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/index.md) 。
[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。
#### 更多信息:

View File

@@ -0,0 +1,65 @@
---
title: Object Assign
localeTitle: 对象分配
---
## 对象分配
这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-assign/index.md) 。
[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。
`Object.assign()`方法用于1向现有对象添加属性和值2创建现有对象的新副本或3将多个现有对象组合到单个对象中。 `Object.assign()`方法需要一个targetObject作为参数并且可以接受无限数量的sourceObject作为附加参数。
这里需要注意的是始终会修改targetObject参数。如果该参数指向现有对象则将同时修改和复制该对象。但是如果希望在不修改原始对象的情况下创建对象的副本则可以将空对象`{}`作为第一个或targetObject参数传递将要复制的对象作为第二个或sourceObject参数传递。
如果作为参数传递给`Object.assign()`共享相同的属性(或键),则稍后在参数列表中出现的属性值将覆盖之前出现的属性值。
**句法**
```javascript
Object.assign(targetObject, ...sourceObject)
```
**回报价值**
`Object.assign()`返回targetObject。
**例子**
_修改和复制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 }
```
_无需修改即可复制targetObject_
```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 }
```
_具有相同属性的对象_
```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 }
```
#### 更多信息:
[MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
[ES6中的Object.assign简介视频](https://youtu.be/vM7Tif98Dlo)

View File

@@ -0,0 +1,11 @@
---
title: Object Create
localeTitle: 对象创建
---
## 对象创建
这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-create/index.md) 。
[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。
#### 更多信息:

View File

@@ -0,0 +1,11 @@
---
title: Object defineProperties
localeTitle: 对象defineProperties
---
## 对象defineProperties
这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-defineproperties/index.md) 。
[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。
#### 更多信息:

View File

@@ -0,0 +1,11 @@
---
title: Object defineProperty
localeTitle: 对象defineProperty
---
## 对象defineProperty
这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-defineproperty/index.md) 。
[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。
#### 更多信息:

View File

@@ -0,0 +1,191 @@
---
title: Object Destructuring
localeTitle: 对象解构
---
# 对象解构
解构是从存储在对象中的数据中提取多个值的便捷方式。它可以在接收数据的位置使用(例如,分配的左侧)。 `ECMAScript 6`引入了此功能。
如何提取值通过模式指定(请参阅示例)。
### 基本任务
```
var userInfo = {name: 'neel', age: 22};
var {name, age} = userInfo;
console.log(name); // neel
console.log(age); // 22
```
### 没有声明的作业
变量可以通过与其声明分开的解构来赋值。
```
var name, age;
({name, age} = {name: 'neel', age: 22});
```
> 在没有声明的情况下使用对象文字解构赋值时,赋值语句周围的`( .. )`是必需的语法。
>
> `{name, age} = {name: 'neel', age: 22}`不是有效的独立语法,因为左侧的`{name, age}`被视为块而不是对象文字。
>
> 但是, `({name, age} = {name: 'neel', age: 22})`是有效的,因为`var {name, age} = {name: 'neel', age: 22}`
### 分配给新变量名称
可以从对象解压缩属性,并将其分配给名称与对象属性不同的变量。
```
var userInfo = {a: 'neel', b: 22};
var {a: name, b: bar} = userInfo;
console.log(name); // neel
console.log(bar); // 22
```
### 默认值
如果`undefined`从对象解压缩的值,则可以为变量分配默认值。
```
var {name = 'ananonumys', age = 20} = {name: 'neel'};
console.log(name); // neel
console.log(age); // 20
```
### 分配新变量名称并提供默认值
房产可以是两者
1. 从对象解压缩并分配给具有不同名称的变量
2. 如果unpacked值`undefined`分配一个默认值。
```
var {a:name = 'ananonumys', b:age = 20} = {age: 22};
console.log(name); // ananonumys
console.log(age); // 22
```
### 设置函数参数的默认值
#### ES5版本
```
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版本
```
function getUserInfo({name = 'ananonumys', age = 20, location = 'india'} = {}) {
console.log(name, age, location);
// print user data
}
getUserInfo({
name: 'neel',
age: 22,
location: 'canada'
});
```
> 在上面的`getUserInfo`的函数签名中,解构的左侧被分配给右侧的空对象文字: `{name = 'ananonumys', age = 20, location = 'india'} = {}` 。您也可以在没有右侧分配的情况下编写该函数。但是,如果省略右侧赋值,函数将在调用时查找至少一个要提供的参数,而在当前形式中,您只需调用`getUserInfo()`而不提供任何参数。如果您希望能够在不提供任何参数的情况下调用函数,则当前设计非常有用,另一个在您希望确保将对象传递给函数时非常有用。
### 嵌套对象和数组解构
```
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"
```
### 用于迭代和解构
```
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"
```
### 从作为函数参数传递的对象中解压缩字段
```
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"
```
这将解压缩用户对象中的`id` `displayName``firstName`并打印它们。
### 计算对象属性名称和解构
```
let key = 'z';
let {[key]: foo} = {z: 'bar'};
console.log(foo); // "bar"
```
另请参见: **对象解构** | [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#Object_destructuring)

View File

@@ -0,0 +1,11 @@
---
title: Object Entries
localeTitle: 对象条目
---
## 对象条目
这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-entries/index.md) 。
[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。
#### 更多信息:

View File

@@ -0,0 +1,68 @@
---
title: Object Freeze
localeTitle: 对象冻结
---
## 对象冻结
`Object.freeze()`方法冻结了一个对象。冻结的对象会_阻止您_
* 添加新属性
* 从中删除现有的特性
* 更改其现有属性的可枚举性,可配置性或可写性
### 句法
```javascript
Object.freeze(obj)
```
### 参数
`obj`
* 要冻结的对象。
### 返回
冻结的物体。
### 重要的提示
尝试添加,删除或修改冻结对象的属性将导致失败。此失败将是静默或抛出`TypeError` (如果启用了严格模式)。另外, `Object.freeze()`是一个浅操作。这意味着冻结对象的嵌套对象是可修改的。
### 例
```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']
```
#### 更多信息:
[MDN文档](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze)

View File

@@ -0,0 +1,11 @@
---
title: Object getOwnPropertyDescriptor
localeTitle: 对象getOwnPropertyDescriptor
---
## 对象getOwnPropertyDescriptor
这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-getownpropertydescriptor/index.md) 。
[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。
#### 更多信息:

View File

@@ -0,0 +1,11 @@
---
title: Object getOwnPropertyDescriptors
localeTitle: Object getOwnPropertyDescriptors
---
## Object getOwnPropertyDescriptors
这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-getownpropertydescriptors/index.md) 。
[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。
#### 更多信息:

View File

@@ -0,0 +1,75 @@
---
title: Object getOwnPropertyNames
localeTitle: Object getOwnPropertyNames
---
`Object.getOwnPropertyNames()`方法返回直接在给定对象上找到的所有属性(可枚举或不可枚举`Object.getOwnPropertyNames()`的数组。
## 句法
```
Object.getOwnPropertyNames(obj)
```
### 参数
**OBJ**
将返回其可枚举_和不可枚举的_自身属性的对象。
[MDN链接](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames) | [MSDN链接](https://msdn.microsoft.com/en-us/LIBRary/ff688126%28v=vs.94%29.aspx)
## 描述
`Object.getOwnPropertyNames()`返回一个数组其元素是与直接在对象上找到的可枚举_和不可枚举_属性相对应的字符串。数组中可枚举属性的排序与`for...in`循环(或`Object.keys()` )在对象属性上公开的顺序一致。未定义数组中以及可枚举属性中的非可枚举属性的顺序。
## 例子
```
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,11 @@
---
title: Object getOwnPropertySymbols
localeTitle: 对象getOwnPropertySymbols
---
## 对象getOwnPropertySymbols
这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-getownpropertysymbols/index.md) 。
[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。
#### 更多信息:

View File

@@ -0,0 +1,11 @@
---
title: Object.prototype.get.prototype.of
localeTitle: Object.prototype.get.prototype.of
---
## Object.prototype.get.prototype.of
这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-getprototypeof/index.md) 。
[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。
#### 更多信息:

View File

@@ -0,0 +1,57 @@
---
title: Object Is
localeTitle: 对象是
---
# 对象是
## 描述
`object.is()`方法用于确定两个值是否相同。这种方法是在ES6中引入的。
## 句法
`Object.is(val1, val2)`
### 参数
**val1** - 要比较的第一个值
**val2** - 要比较的第二个值
## 返回值
一个[布尔值,](https://guide.freecodecamp.org/javascript/booleans)指示两个参数是否具有相同的值
## 描述
`Object.is()`比较两个相同的值,如果两个值满足以下条件之一,则返回`true`
* `undefined`
* `null`
* 无论是`true`还是`false`
* 具有相同长度和相同字符的字符串
* 相同的对象
* 这两个数字和:
* `+0`或两者都是`-0`
* 两个`NaN`
* 或两者都不是零而不是`NaN`
## 例子
\`\`\`
Object.is'string''string'; //真的 Object.isundefinedundefined; //真的 Object.isnullnull; //真的
Object.is'string'word'; //假 Object.istruefalse; //假 Object.is\[\]\[\]; //假
var obj = {nameJane}; Object.isobjobj; //真的
Object.isNaNNaN; //真的
Object.is+ 0-0; //假 Object.is-0-0; //真的
\`\`\`
#### 更多信息:
[Object.isMDN Web文档](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) [严格的相等运算符`===`](https://guide.freecodecamp.org/certificates/comparison-with-the-strict-equality-operator)

View File

@@ -0,0 +1,11 @@
---
title: Object isExtensible
localeTitle: 对象是可扩展的
---
## 对象是可扩展的
这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-isextensible/index.md) 。
[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。
#### 更多信息:

View File

@@ -0,0 +1,39 @@
---
title: Object isFrozen
localeTitle: 对象是冷冻
---
## 对象是冷冻
您可以使用**`Object.isFrozen()`**来确定对象是否已冻结。它返回**`true`**或**`false`**布尔值。
#### **句法**
```javascript
Object.isFrozen(obj)
```
**例如:**
```javascript
var foods = {
grain : "wheat",
dairy : "milk",
vegetable : "carrot",
fruit : "grape"
};
var frozenFoods = Object.freeze(foods);
var areMyFoodsFrozen = Object.isFrozen(frozenFoods);
\\ returns true
```
请记住,冻结的对象**不能**更改其属性。
如果您尝试在非对象参数上使用**`Object.isFrozen()`** ,它将返回`true`
#### 更多信息:
[MDN Object.isFrozen](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen)
[MDN Object.freeze](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze)

View File

@@ -0,0 +1,11 @@
---
title: Object Issealed
localeTitle: 对象已密封
---
## 对象已密封
这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-issealed/index.md) 。
[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。
#### 更多信息:

View File

@@ -0,0 +1,65 @@
---
title: Object Keys
localeTitle: 对象键
---
`Object.keys()`方法返回给定对象自己的可枚举属性的数组,其顺序与`for...in`循环提供的顺序相同(不同之处在于`for-in`循环枚举原型链中的属性为好)。
## 句法
```
Object.keys(obj)
```
### 参数
**OBJ**
要返回其可枚举自身属性的对象。
[MDN链接](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys) | [MSDN链接](https://msdn.microsoft.com/en-us/LIBRary/ff688127%28v=vs.94%29.aspx)
## 描述
`Object.keys()`返回一个数组,其元素是与直接在对象上找到的可枚举属性相对应的字符串。属性的顺序与通过手动循环对象的属性给出的顺序相同。
## 例子
```
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,11 @@
---
title: Object preventExtensions
localeTitle: 对象preventExtensions
---
## 对象preventExtensions
这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-preventextentions/index.md) 。
[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。
#### 更多信息:

View File

@@ -0,0 +1,11 @@
---
title: Object.prototype.__defineGetter__
localeTitle: Object.prototype中.__ defineGetter__
---
## Object.prototype中。 **defineGetter**
这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-prototype-__definegetter__/index.md) 。
[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。
#### 更多信息:

View File

@@ -0,0 +1,11 @@
---
title: Object.prototype.__defineSetter__
localeTitle: Object.prototype中.__ defineSetter__
---
## Object.prototype中。 **defineSetter**
这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-prototype-__definesetter__/index.md) 。
[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。
#### 更多信息:

View File

@@ -0,0 +1,46 @@
---
title: Object.prototype.hasOwnProperty
localeTitle: Object.prototype.hasOwnProperty
---
## Object.prototype.hasOwnProperty
### 句法
`Object.hasOwnProperty(prop)`
### 描述
**hasOwnProperty**方法返回一个[布尔值,](https://developer.mozilla.org/en-US/docs/Glossary/Boolean)指示对象是否拥有指定的属性。
这是检查对象是否具有指定属性的便捷方法;相应地返回true / false。
### 参数
##### 支柱
要测试的[字符串](https://developer.mozilla.org/en-US/docs/Glossary/String)或[符号](https://developer.mozilla.org/en-US/docs/Glossary/Symbol) 。
### 例子
使用**hasOwnProperty**来测试给定对象中是否存在属性:
```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
```
#### 链接
[MDN hasOwnProperty](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty)

View File

@@ -0,0 +1,11 @@
---
title: Object.prototype.is.prototype.of
localeTitle: Object.prototype.is.prototype.of
---
## Object.prototype.is.prototype.of
这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-prototype-isprototypeof/index.md) 。
[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。
#### 更多信息:

View File

@@ -0,0 +1,11 @@
---
title: Object.prototype.__lookupGetter__
localeTitle: Object.prototype中.__ lookupGetter__
---
## Object.prototype中。 **lookupGetter**
这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-prototype-__lookupgetter__/index.md) 。
[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。
#### 更多信息:

View File

@@ -0,0 +1,11 @@
---
title: Object.prototype.__lookupSetter__
localeTitle: Object.prototype中.__ lookupSetter__
---
## Object.prototype中。 **lookupSetter**
这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-prototype-__lookupsetter__/index.md) 。
[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。
#### 更多信息:

View File

@@ -0,0 +1,11 @@
---
title: Object.prototype.propertyIsEnumerable
localeTitle: Object.prototype.propertyIsEnumerable
---
## Object.prototype.propertyIsEnumerable
这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-prototype-propertyisenumerable/index.md) 。
[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。
#### 更多信息:

View File

@@ -0,0 +1,11 @@
---
title: Object.prototype.set.prototype.of
localeTitle: Object.prototype.set.prototype.of
---
## Object.prototype.set.prototype.of
这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-prototype-setprototypeof/index.md) 。
[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。
#### 更多信息:

View File

@@ -0,0 +1,11 @@
---
title: Object.prototype.tolocalstring
localeTitle: Object.prototype.tolocalstring
---
## Object.prototype.tolocalstring
这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-prototype-tolocalstring/index.md) 。
[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。
#### 更多信息:

View File

@@ -0,0 +1,11 @@
---
title: Object.prototype.toSource
localeTitle: Object.prototype.toSource
---
## Object.prototype.toSource
这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-prototype-tosource/index.md) 。
[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。
#### 更多信息:

View File

@@ -0,0 +1,11 @@
---
title: Object.prototype.toString
localeTitle: Object.prototype.toString
---
## Object.prototype.toString
这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-prototype-tostring/index.md) 。
[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。
#### 更多信息:

View File

@@ -0,0 +1,11 @@
---
title: Object.prototype.unwatch
localeTitle: Object.prototype.unwatch
---
## Object.prototype.unwatch
这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-prototype-unwatch/index.md) 。
[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。
#### 更多信息:

View File

@@ -0,0 +1,11 @@
---
title: Object.prototype.valueOf
localeTitle: Object.prototype.valueOf
---
## Object.prototype.valueOf
这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-prototype-valueof/index.md) 。
[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。
#### 更多信息:

View File

@@ -0,0 +1,11 @@
---
title: Object.prototype.watch
localeTitle: Object.prototype.watch
---
## Object.prototype.watch
这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-prototype-watch/index.md) 。
[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。
#### 更多信息:

View File

@@ -0,0 +1,11 @@
---
title: Object Prototype.constructor
localeTitle: Object Prototype.constructor
---
## Object Prototype.constructor
这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-prototype.constructor/index.md) 。
[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。
#### 更多信息:

View File

@@ -0,0 +1,11 @@
---
title: Object Seal
localeTitle: 对象密封
---
## 对象密封
这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-seal/index.md) 。
[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。
#### 更多信息:

View File

@@ -0,0 +1,11 @@
---
title: Object.prototype.set.prototype.of
localeTitle: Object.prototype.set.prototype.of
---
## Object.prototype.set.prototype.of
这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/object/object-setprototypeof/index.md) 。
[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。
#### 更多信息:

View File

@@ -0,0 +1,48 @@
---
title: Object Values
localeTitle: 对象值
---
`Object.values()`方法返回给定对象自己的可枚举属性值的数组其顺序与for ... in循环提供的顺序相同不同之处在于for-in循环枚举原型链中的属性 )。
## 句法
```
Object.values(obj)
```
### 参数
**OBJ**
要返回其可枚举自身属性的对象。
[MDN链接](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/values)
## 描述
`Object.values()`返回一个数组其元素是在对象上找到的可枚举属性值。属性的顺序与手动循环对象的属性值所给出的顺序相同。换句话说对象具有键值对并且此方法返回该对象在类数组对象中的所有_值_ 。
请参阅[Object.keys](https://guide.freecodecamp.org/javascript/standard-objects/object/object-keys/) 它返回该对象在类数组对象中的所有_键_ 。
## 例子
```
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']
```
\* _在Internet Explorer中不起作用_