mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-01-04 00:05:28 -05:00
chore(i18n,learn): processed translations (#48570)
This commit is contained in:
@@ -11,7 +11,7 @@ dashedName: using-objects-for-lookups
|
||||
|
||||
对象和字典一样,可以用来存储键/值对。 如果数据是扁平的,你可以用对象来查找你想要的值,而不是链式使用 `switch` 或 `if/else` 语句。 当你知道你的输入数据在某个范围时,这种查找方式极为有效。
|
||||
|
||||
Here is an example of an article object:
|
||||
这是一个文章对象的示例:
|
||||
|
||||
```js
|
||||
const article = {
|
||||
@@ -30,7 +30,7 @@ const value = "title";
|
||||
const valueLookup = article[value];
|
||||
```
|
||||
|
||||
`articleAuthor` is the string `Kaashan Hussain`, `articleLink` is the string `https://www.freecodecamp.org/news/a-complete-guide-to-creating-objects-in-javascript-b0e2450655e8/`, and `valueLookup` is the string `How to create objects in JavaScript`.
|
||||
`articleAuthor` 是字符串 `Kaashan Hussain`,`articleLink` 是字符串 `https://www.freecodecamp.org/news/a-complete-guide-to-creating-objects-in-javascript-b0e2450655e8/`,`valueLookup` 是字符串 `How to create objects in JavaScript`。
|
||||
|
||||
# --instructions--
|
||||
|
||||
|
||||
Reference in New Issue
Block a user