Makes a function behaves as a method.