I have a question i have always written functions in javascript for returning or setting values of other elements like so:
function test(x, y){
return x*y;
}
and call the function like so:
test(20, 50);
but in libraries like jquery you also see functions like so:
var test = something.test();
so my question is what is the difference between the following functions .test() or test()
or are they the same and how is this other way of writing a function called?
and how do you write a .function()
Hope to learn something new, sorry if this is a bit random but i am just very curious.