If you are not sure if the website you would like to visit is secure, you can verify it here. Enter the website address of the page and see parts of its content and the thumbnail images on this site. None (if any) dangerous scripts on the referenced page will be executed. Additionally, if the selected site contains subpages, you can verify it (review) in batches containing 5 pages.
favicon.ico: javascript-tutorial.com/objects/prototypes-inheritance-extension - Prototypes: Inheritance & .

site address: javascript-tutorial.com/objects/prototypes-inheritance-extension redirected to: javascript-tutorial.com/objects/prototypes-inheritance-extension

site title: Prototypes: Inheritance & extension - The complete JavaScript Tutorial

Our opinion (on Thursday 19 November 2026 6:39:33 UTC):

GREEN status (no comments) - no comments
After content analysis of this website we propose the following hashtags:



Meta tags:

Headings (most frequently used words):

javascript, objects, the, for, web, inheritance, object, prototypes, extension, extending, prototypical, summary, chapter, article, toc, about, getting, started, basics, control, structures, data, types, built, in, operators, functions, classes, error, handling, regular, expressions, general, bom, dom, what, is, this, setprototypeof, vs, create,

Text of the page (most frequently used words):
the (93), #object (45), this (33), you (26), and (22), dog (21), javascript (20), array (19), method (18), animal (16), for (15), prototype (13), objects (13), introduction (12), inheritance (12), have (10), which (10), can (10), create (10), prototypes (9), but (9), with (9), cat (9), function (9), your (8), from (8), use (8), numberoflegs (8), existing (8), add (7), hascat (7), methods (7), article (6), not (6), what (6), all (6), that (6), prototypical (6), let (6), could (6), specific (6), operators (6), about (5), classes (5), built (5), new (5), example (5), setprototypeof (5), greet (5), then (5), return (5), useful (5), how (5), operator (5), tutorial (4), want (4), based (4), model (4), just (4), values (4), notice (4), property (4), alert (4), make (4), instance (4), extend (4), extending (4), regular (4), extension (4), functions (4), been (3), into (3), languages (3), language (3), already (3), they (3), are (3), where (3), more (3), class (3), system (3), instead (3), chain (3), used (3), alternative (3), approach (3), many (3), above (3), assign (3), its (3), will (3), when (3), after (3), whether (3), inheriting (3), while (3), bark (3), general (3), need (3), animals (3), own (3), functionality (3), now (3), includes (3), contains (3), try (3), using (3), web (3), expressions (3), catching (3), getters (3), setters (3), suggest (2), has (2), here (2), next (2), previous (2), chapter (2), through (2), recent (2), versions (2), upon (2), introduced (2), coming (2), programming (2), actually (2), might (2), talked (2), older (2), both (2), summary (2), first (2), because (2), only (2), like (2), any (2), happens (2), allow (2), also (2), uses (2), even (2), two (2), always (2), reference (2), one (2), shared (2), different (2), thanks (2), access (2), handles (2), keyword (2), see (2), easy (2), build (2), modify (2), legs (2), world (2), members (2), hello (2), lot (2), may (2), behavior (2), allowing (2), arrays (2), type (2), handling (2), work (2), really (2), version (2), simply (2), declare (2), done (2), our (2), libraries (2), concept (2), asp (2), net (2), dom (2), window (2), bom (2), search (2), error (2), types (2), conditional (2), errors (2), catch (2), fields (2), accessors (2), properties (2), parameters (2), basics (2), loops (2), statement (2), toc (2), localization, correction, contact, com, 2007, 2026, fully, translated, following, preferred, list, help, translate, click, czech, know, learn, look, aspects, addition, however, ecmascript, specification, probably, please, programmers, abstraction, accomplish, same, things, matter, prefer, familiar, easier, understand, relying, directly, last, couple, articles, originally, oriented, find, old, parameter, case, according, allows, better, optimization, code, drawback, lack, support, legacy, browsers, internet, explorer, since, supported, microsoft, longer, major, issue, preferable, documentation, take, newly, created, called, clearly, illustrates, single, line, means, write, separate, knows, other, them, between, seen, luckily, optimal, way, indeed, across, previously, interpreter, meets, refers, currently, execution, very, point, wanted, race, inherit, original, won, exist, belongs, generic, defines, amount, greeting, set, basically, woof, another, inherits, sense, perhaps, course, scratch, would, there, chose, particularly, don, clutter, drastic, changes, underlying, wouldn, scenarios, times, declared, available, whenever, custom, etc, mouse, referencing, name, inside, call, hard, checking, comes, covered, silly, show, without, further, ado, introduce, tell, demonstrate, saw, were, inherited, dig, bit, deeper, combination, wpf, php5, jquery, html5, css3, webforms, mvc, location, history, script, tag, replace, capturing, groups, match, regex, flags, options, throwing, finally, static, multiple, recursive, callback, anonymous, default, optional, chaining, nullish, coalescing, ternary, remainder, logical, increment, decrement, arithmetic, comparison, assignment, json, math, date, string, number, conversion, null, undefined, strings, numbers, booleans, data, switch, control, structures, truthy, falsy, variables, basic, syntax, tools, getting, started, webbrowser, table, contents, complete,


Text of the page (random words):
prototypes inheritance extension the complete javascript tutorial javascript tutorial toc table of contents chapter article toc introduction properties methods property accessors getters setters prototypes prototypes inheritance extension extending objects prototypical inheritance what is this object setprototypeof vs object create summary about javascript what is javascript javascript and the webbrowser javascript libraries getting started the tools you need hello world the basics basic javascript syntax variables truthy falsy control structures the if statement the switch statement loops for and while loops for of and for in data types introduction booleans numbers strings null undefined type conversion built in objects introduction number string array the basics array methods date math json operators introduction the assignment operator comparison operators arithmetic operators increment decrement operators modify and assign operators logical operators remainder operator conditional ternary operator nullish coalescing operator optional chaining operator functions introduction function parameters function parameters with default values anonymous functions callback functions recursive functions multiple return values objects introduction properties methods property accessors getters setters prototypes prototypes inheritance extension classes introduction fields methods getters setters inheritance static fields methods error handling introduction catching errors try catch catching throwing errors try catch finally error types conditional catching regular expressions introduction regex flags options search match with regular expressions using capturing groups search replace with regular expressions javascript for web general introduction window dom bom the script tag javascript for web the bom the window object the history object the location object javascript for web the dom introduction javascript asp net mvc asp net webforms c css3 html5 jquery php5 wpf objects prototypes inheritance extension in the previous article we introduced you to the concept of prototypes and the prototype chain in general we saw how members were inherited through the prototype chain but in this article we ll dig a bit deeper on the concept of prototypical inheritance and how we can use it in combination with existing objects to extend the functionality extending objects first let s see how we can use the prototype system to extend an existing object this could be your own object but for this example i ll demonstrate it by extending an existing built in object the array object now the array object already comes with so many useful methods as we covered in the article on array methods so instead of coming up with a useful method we ll add a silly one just to show how easy it can be done so without further ado allow me to introduce the hascat method which will tell you whether your array contains a cat or not array prototype hascat function return this includes cat i extend the existing array object by referencing array prototype and then i simply declare the function with the name hascat notice that inside the function i can reference the instance of the array by using the this keyword allowing me to call the includes method on it which will do all the hard work of checking whether the array contains a cat or not now let s try using our new method array prototype hascat function return this includes cat let animals dog cat mouse alert array contains a cat animals hascat notice how i declare a regular array as we ve done many times in this tutorial already but on this array instance i now have access to our hascat method after it has been declared all your arrays have this new method available this can be really useful whenever you want to add your own custom functionality to the existing javascript objects or to objects from libraries you use etc prototypical inheritance as an alternative to extending existing objects you may chose to simply create your own version of it this can be particularly useful if you don t want to clutter existing objects or if you want to make drastic changes to the underlying functionality which wouldn t be useful in all scenarios for instance the above example where we add the hascat method to the built in array object might not make sense for all arrays perhaps you need a specific type of array for handling animals you could of course build it from scratch but that would be a lot of work and there s really no need to instead we can just make a new version of the array object which uses prototypical inheritance from the built in array object this is also used a lot to make more specific versions of another object for instance you may create an animal object and then extend it into e g a dog and or a cat object which inherits the general behavior from the animal object while allowing you to add dog or cat specific behavior to the new objects here s an example let animal numberoflegs 0 greet function return hello i m an animal i have this numberoflegs legs let dog object setprototypeof dog animal dog numberoflegs 4 dog bark function return woof alert animal greet alert dog greet alert dog bark so we have a generic animal object which defines an amount of legs and a function for greeting the world we then create a dog object and use the setprototypeof method to set the prototype of the dog object to the animal object basically inheriting its members after that we modify the numberoflegs property and then we add a dog specific bark method to the dog object this method won t exist on the animal object only on the dog object where it belongs as you can see it s very easy to build upon an existing object thanks to prototypical inheritance at this point you could add a cat object based on the animal object or if you wanted to be even more specific you could add a specific dog race which could then be based on and inherit from the original dog object what is this in the above example you ll notice my use of the this keyword as we previously talked about when the interpreter meets this it always refers to the object which currently handles the execution but what happens when a method is shared between two different objects thanks to inheritance as we have just seen with the greet method you ll notice that in this method i access this numberoflegs in the greet method but luckily for us javascript handles this in the optimal way while the method is indeed shared the numberoflegs property can have different values across the animal object and objects inheriting from it this also means that when the animal object uses this numberoflegs even after we write to dog numberoflegs they are two separate values and javascript always knows whether this is a reference to animal or dog or any other object inheriting from one of them object setprototypeof vs object create in the example above i use the object setprototypeof method to take a newly created object called dog and assign the animal object as its prototype i use this approach because it clearly illustrates what happens but as an alternative we could have used the object create method it will allow us to both create the dog object and assign its prototype in a single line like this let dog object create animal the first parameter of the create method is the prototype in this case animal according to the documentation the object create approach is actually preferable because it allows for better optimization of your code the only drawback is the lack of support in legacy browsers like internet explorer 8 and older but since they are not supported by microsoft any longer this is not a major issue summary in the last couple of articles we have talked about object prototypes the prototype chain and prototypical inheritance this system is the model javascript originally used as an alternative to the older object oriented class based approach you ll find in many programming languages both old and new however in more recent versions of the ecmascript specification which javascript is built upon classes have been introduced probably to please programmers coming from class based programming languages the javascript class model is actually just an abstraction of the prototype system so you can accomplish the same things no matter which model you prefer but if you re familiar with classes it might be easier for you to understand and use classes in javascript instead of relying directly on the prototype model so if you already know about classes or if you want to learn what they are all about i suggest that you have a look at the next chapter where we ll go through all aspects of this recent addition to the javascript language prototypes previous introduction next this article has been fully translated into the following languages czech is your preferred language not on the list click here to help us translate this article into your language javascript tutorial com 2007 2026 contact us suggest correction localization
Thumbnail images (randomly selected): * Images may be subject to copyright.GREEN status (no comments)

    No Images


    Verified site has: 72 subpage(s). Do you want to verify them? Verify pages:

    1-5 6-10 11-15 16-20 21-25 26-30 31-35 36-40 41-45 46-50
    51-55 56-60 61-65 66-70 71-72


    Top 50 hastags from of all verified websites.

    Supplementary Information (add-on for SEO geeks)*- See more on header.verify-www.com

    Header

    HTTP/1.1 302 Redirect
    Content-Type text/html; charset=UTF-8
    Location htt????/javascript-tutorial.com/objects/prototypes-inheritance-extension
    Server Microsoft-IIS/10.0
    X-Powered-By ASP.NET
    Date Thu, 19 Nov 2026 06:39:33 GMT
    Connection close
    Content-Length 195
    HTTP/2 301
    cache-control private
    content-type text/html; charset=utf-8
    location /objects/prototypes-inheritance-extension/
    server Microsoft-IIS/10.0
    set-cookie ASP.NET_SessionId=i5evywjeyohjosprua0dkgam; path=/; HttpOnly; SameSite=Lax
    x-aspnetmvc-version 5.2
    x-aspnet-version 4.0.30319
    x-powered-by ASP.NET
    date Thu, 19 Nov 2026 06:39:33 GMT
    content-length 159
    HTTP/2 200
    cache-control private
    content-type text/html; charset=utf-8
    server Microsoft-IIS/10.0
    set-cookie ASP.NET_SessionId=sdivkggcoqci1mkuolz4a4qn; path=/; HttpOnly; SameSite=Lax
    x-aspnetmvc-version 5.2
    x-aspnet-version 4.0.30319
    x-powered-by ASP.NET
    date Thu, 19 Nov 2026 06:39:33 GMT
    content-length 27999

    Meta Tags

    title="Prototypes: Inheritance & extension - The complete JavaScript Tutorial"
    name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"

    Load Info

    page size27999
    load time (s)0.282614
    redirect count2
    speed download99287
    server IP 142.132.248.53
    * all occurrences of the string "http://" have been changed to "htt???/"