Permalink
Browse files

[docs] Fix misnamed 'Object.keys' in API docs (#2979)

1 parent bf7afb1 commit 7199d1b6ef812a13a4df09b5155b52f52517ea2d @ncoden ncoden committed with darrachequesne Jun 19, 2017
Showing with 2 additions and 2 deletions.
  1. +2 −2 docs/API.md
View
@@ -503,7 +503,7 @@ A hash of strings identifying the rooms this client is in, indexed by room name.
```js
io.on('connection', (socket) => {
socket.join('room 237', () => {
- let rooms = Objects.keys(socket.rooms);
+ let rooms = Object.keys(socket.rooms);
console.log(rooms); // [ <socket.id>, 'room 237' ]
});
});
@@ -659,7 +659,7 @@ Adds the client to the `room`, and fires optionally a callback with `err` signat
```js
io.on('connection', (socket) => {
socket.join('room 237', () => {
- let rooms = Objects.keys(socket.rooms);
+ let rooms = Object.keys(socket.rooms);
console.log(rooms); // [ <socket.id>, 'room 237' ]
io.to('room 237', 'a new user has joined the room'); // broadcast to everyone in the room
});

0 comments on commit 7199d1b

Please sign in to comment.