Sorry for very stupid question, I'm not an English speaker and it's very hard for me to find keyword in search for deeper knowledge of something like this: var foo = { bar: function( i ) { this.i = i; console.log( 'It\n's ' + i ); } } var x = 'fubar'; var y = foo.bar( x ); Code (markup):
I think your question was "What does this method do in JavaScript?" Answer is: It creates an object called foo and then creates a method inside that object called bar which can take one parameter called i. It then logs into the console "It's i" (i being what's being passed) which is set to x and then called with y = foo.bar(x).
In object orientated JavaScript there are "methods" https://developer.mozilla.org/en-US/docs/Web/JavaScript/Introduction_to_Object-Oriented_JavaScript