fix(Docs): fix Console example (#1961)

Fixes #1874
This commit is contained in:
Yaniv Efraim 2018-02-06 00:44:22 +02:00 committed by Andrey Lushnikov
parent bc6902623a
commit 2f1157b044

View File

@ -428,8 +428,8 @@ The arguments passed into `console.log` appear as arguments on the event handler
An example of handling `console` event: An example of handling `console` event:
```js ```js
page.on('console', msg => { page.on('console', msg => {
for (let i = 0; i < msg.args.length; ++i) for (let i = 0; i < msg.args().length; ++i)
console.log(`${i}: ${msg.args[i]}`); console.log(`${i}: ${msg.args()[i]}`);
}); });
page.evaluate(() => console.log('hello', 5, {foo: 'bar'})); page.evaluate(() => console.log('hello', 5, {foo: 'bar'}));
``` ```