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:
```js
page.on('console', msg => {
for (let i = 0; i < msg.args.length; ++i)
console.log(`${i}: ${msg.args[i]}`);
for (let i = 0; i < msg.args().length; ++i)
console.log(`${i}: ${msg.args()[i]}`);
});
page.evaluate(() => console.log('hello', 5, {foo: 'bar'}));
```