未验证 提交 0955569f 编写于 作者: O openharmony_ci 提交者: Gitee

!7054 Modify IDE error

Merge pull request !7054 from 周飞/master
...@@ -108,10 +108,10 @@ Obtains all the key-value pairs based on the specified key. ...@@ -108,10 +108,10 @@ Obtains all the key-value pairs based on the specified key.
**Example** **Example**
```js ```js
let urlObject = new Url.URL('https://developer.exampleUrl/?fod=1&bard=2'); let urlObject = new Url.URL('https://developer.exampleUrl/?fod=1&bard=2');
let paramsObject = new Url.URLSearchParams(urlObject.search.slice(1)); let params = new Url.URLSearchParams(urlObject.search.slice(1));
paramsObject.append('fod', 3); // Add a second value for the fod parameter. params.append('fod', '3'); // Add a second value for the fod parameter.
console.log(params.getAll('fod')) // Output ["1","3"]. console.log(params.getAll('fod').toString()) // Output ["1","3"].
``` ```
......
...@@ -119,16 +119,16 @@ Processes an asynchronous function and returns a promise version. ...@@ -119,16 +119,16 @@ Processes an asynchronous function and returns a promise version.
**Example** **Example**
```js ```js
function aysnFun(str1, str2, callback) { function aysnFun(str1, str2) {
if (typeof str1 === 'string' && typeof str2 === 'string') { if (typeof str1 === 'object' && typeof str2 === 'object') {
callback(null, str1 + str2); return str2
} else { } else {
callback('type err'); return str1
} }
} }
let newPromiseObj = util.promiseWrapper(aysnFun)("Hello", 'World'); let newPromiseObj = util.promiseWrapper(aysnFun);
newPromiseObj.then(res => { newPromiseObj({ err: "type error" }, {value:'HelloWorld'}).then(res => {
console.log(res); console.log(res);
}) })
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册