theritically, i want to know the differences
A function is a block of code that performs a specific task. It can be called directly by its name. A method is a function that belongs to an object. It is called using the object name followed by a dot (.).