Basically, if you have a method inside a constructor it will be available for all the instance of the object created, which will increase the memory space. If you have it in prototype It will be available for all the created object, but it is available for all the instance also. For example in the above code, if Person class is initiated fro 100 times, for each object sayname method will be available in the object itself. Assume it take 1kb, so finally 100kb will be utilized by the method if you have it inside constructor, but if u have it in prototype it will be present only once, it occupies only 1kb make your code cleaner and increse your performance also.