function()은 독립적인 기능을 수행한다. 반면 메서드는 객체에 대한 동작을 수행한다.
A function doesn't need any object and is independent, while the method is a function, which is linked with any object. We can directly call the function with its name, while the method is called by the object's name. Function is used to pass or return the data, while the method operates the data in a class.
function();
object.method();