It's because you create a specified function for one object only. To improve your work you can create a constructor then reuse the constructor's code to applies it to a specific object.