The constructor function can be used to make this happen.
Yapıcı fonksiyon bunu gerçekleştirmek için kullanılabilir.
So, by the logic of instance of, the prototype actually defines the type, not the constructor function.
Öyleyse, instanceof mantığına göre asıl tipi gelirleyen prototiptir, yapıcı fonksiyon değil.
This time angular uses 'new' keyword and call the constructor function something like below.
Bu sefer açısal 'yeni' anahtar kelimesini kullanır ve aşağıdaki gibi bir yapıcı işlevini çağırır.
Thus, any initialization to be performed on an object can be done automatically by the constructor function.
Böylelikle bir nesne için gerçekleştirilmesi gereken tüm hazırlıklar constructor fonksiyonu tarafından otomatik olarak yapılabilir.
The "prototype" property only has such a special effect when is set to a constructor function, and invoked with new.
"prototype" özelliği sadece bir yapıcı fonksiyona ayarlandığı ve new ile çağırıldığında özel etkisi olur.
For example, if you forget to provide the new prefix when calling a constructor function, the constructor's this will be bound unexpectedly to the global object, so instead of initializing a new object, it will instead be silently tampering with global variables.
Örneğin, bir yapıcı işlevini çağırdığınızda önekle new vermeyi unuttuysanız, this yapıcı beklenmedik bir şekilde genel bir nesneyle ilişkilendirilir, bu nedenle yeni bir nesneyi başlatmak yerine, bunun yerine genel değişkenlerle sessizce tahrif olur.
For example, if you forget to provide the new prefix when calling a constructor function, the constructor's this will be bound unexpectedly to the global object, so instead of initializing a new object, it will instead be silently tampering with global variables.
Örneğin, eğer unutursanız sağlamak new Bir yapıcı işlevini çağırırken önek, yapıcı adlı this beklenmedik şekilde global nesneye bağlı olacak yeni bir nesneyi başlatmak yerine, sessizce global değişkenlerle kurcalamak.
Now that we have our Person constructor function and our sayName function on its prototype, let's actually create an instance of Person then call the sayName function.
Şimdi bizim şahsi yapıcı fonksiyonumuza ve bizim isimim fonksiyonumuzun prototipine sahip olduğumuza göre, aslında bir Kişi örneğini oluşturalım ve sonra sayName fonksiyonunu çağırın.
Potentially sensitive or inappropriate content
Examples are used only to help you translate the word or expression searched in various contexts. They are not selected or validated by us and can contain inappropriate terms or ideas. Please report examples to be edited or not to be displayed. Potentially sensitive, inappropriate or colloquial translations are usually marked in red or in orange.