未验证 提交 90eade70 编写于 作者: 葛亚芳 提交者: Gitee

update zh-cn/application-dev/reference/apis/js-apis-data-preferences.md.

Signed-off-by: N@ge-yafang <geyafang@huawei.com>
上级 7d36762f
......@@ -298,8 +298,8 @@ preferences.getAll(function (err, value) {
console.info("Failed to get all key-values. Cause: " + err);
return;
}
let keys = Object.keys(value);
console.info("getAll keys = " + keys);
let allKeys = Object.keys(value);
console.info("getAll keys = " + allKeys);
console.info("getAll object = " + JSON.stringify(value));
});
```
......@@ -322,8 +322,8 @@ getAll(): Promise&lt;Object&gt;
```js
let promise = preferences.getAll();
promise.then((value) => {
let keys = Object.keys(value);
console.info('getAll keys = ' + keys);
let allKeys = Object.keys(value);
console.info('getAll keys = ' + allKeys);
console.info("getAll object = " + JSON.stringify(value));
}).catch((err) => {
console.info("Failed to get all key-values. Cause: " + err);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册