The first argument to call should be the value that this should have during the function call; in the above, you want it to be to. Then you list the arguments discretely, or you use apply instead and use an array (or an arguments object). In this case, you just want to pass in message because you're using to, so:
to.msgRecieve.call(to, message);
call uses the first argument you give it as this within the function it calls, and passes the function it calls any further arguments you give it. So for instance:
foo.call(something, 'a', 'b', 'c');
...will call foo, and during the call to foo this will be something and foo's arguments are 'a', 'b', and 'c'.
There's also apply, which is exactly the same except you give it the arguments for the function as an array (or as an arguments object):
foo.apply(something, ['a', 'b', 'c']);
There are a couple of other problems, though. As destroy points out, you've also used 'anthony', a string, rather than anthony, your variable. Then in send, you want to get name from to (or better yet, do it in msgRecieve.
function Player(name) {
this.name = name;
this.inbox = [];
}
Player.prototype.viewInbox = function() {
return this.inbox;
}
Player.prototype.msgRecieve = function(msg) {
this.inbox.push({
to: this.name, // <=== Change
msg: msg // <=== Change
});
}
function Mailman(branch) {
this.branchName = branch;
this.send = function(to, message) {
to.msgRecieve.call(to, message); // <=== Change
}
}
var anthony = new Player('anthony');
var ph = new Mailman('PH');
snippet.log(JSON.stringify(anthony.viewInbox())); //[]
ph.send(anthony, 'hello anthony'); //send // <=== Change
snippet.log(JSON.stringify(anthony.viewInbox())); // expecting [object{to:'anthony', msg:'hello anthony'}]
<!-- Script provides the `snippet` object, see http://meta.stackexchange.com/a/242144/134069 -->
<script src="http://tjcrowder.github.io/simple-snippets-console/snippet.js"></script>
anthonyon the other hand (as opposed to'anthony') is a Player object and will have themsgReceiveproperty.