.bind() works just fine for functions. It just doesn't do what you think it does.
See, functions are objects too. And treating them like objects doesn't mean they get called.
function a() { console.log("a was called"); }
function b() { console.log(this); }
var bound = b.bind(a);
bound(); // logs "function a() { }" in my console
In your case, once you've bound test to another, you have a new function that works just like test, but where this means another, and thus this.var means another.var. And all of this happens without another ever getting called.
I'm not sure entirely how you expect your code to work, cause it doesn't make much sense as it stands. But if you were to examine things after you run it, you would find that another.var now has the value 'test123'.
Even if you said another() beforehand, it wouldn't matter. Firstly because another isn't bound to anything, so to it, this means the global object. In a browser, another() would basically just be setting window.var. But secondly, test sets its own value -- so even if both functions had the same idea of what this.var means, test would overwrite it with 'test123'.
another.varafter running this, you should see it set to'test123'. What were you expecting?'test123'before you log anything?anotheris never executed, so the string'another test'is not assigned to anything. You can't output a value that doesn't exist. You are writing out what thetestfunction returns, but it doesn't return any value.bindmethod returns a new function that executes the original one, bound to a context.