From 2f1157b04458f4a4f54a142872410516e56eccb6 Mon Sep 17 00:00:00 2001 From: Yaniv Efraim Date: Tue, 6 Feb 2018 00:44:22 +0200 Subject: [PATCH] fix(Docs): fix Console example (#1961) Fixes #1874 --- docs/api.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api.md b/docs/api.md index 5529d149..76c24e40 100644 --- a/docs/api.md +++ b/docs/api.md @@ -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'})); ```