-
Notifications
You must be signed in to change notification settings - Fork 0
/
simple-javascript-inheritance-by-john-resig-2008.html
92 lines (82 loc) · 4.83 KB
/
simple-javascript-inheritance-by-john-resig-2008.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!DOCTYPE html>
<html lang="fr" prefix="og: http://ogp.me/ns#">
<head>
<link href="http://gmpg.org/xfn/11" rel="profile">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<!-- Metadata -->
<meta name="description" content="I'm a software engineer.<br />I like to write code slowly but with agility and to test new tools. <br />This website was crafted with the assistance of <a href='http://getpelican.com/'>Pelican</a> and <a href='https://github.com/jvanz/pelican-hyde'>Hyde</a>.">
<meta property="og:description" content="I'm a software engineer.<br />I like to write code slowly but with agility and to test new tools. <br />This website was crafted with the assistance of <a href='http://getpelican.com/'>Pelican</a> and <a href='https://github.com/jvanz/pelican-hyde'>Hyde</a>.">
<meta property="og:title" content="Simple JavaScript Inheritance by John Resig, 2008" />
<meta property="og:type" content="article" />
<meta property="og:url" content="/simple-javascript-inheritance-by-john-resig-2008.html" />
<meta property="og:image" content="/images/avatar.png" />
<!-- Enable responsiveness on mobile devices-->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<title>Pierre's website</title>
<!-- CSS -->
<link rel="stylesheet" href="/theme/css/poole.css" />
<link rel="stylesheet" href="/theme/css/hyde.css" />
<link rel="stylesheet" href="/theme/css/syntax.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/fork-awesome.min.css" crossorigin="anonymous">
<!-- Feeds -->
<!-- Analytics -->
</head>
<body class="theme-base-0d">
<div class="sidebar">
<div class="container sidebar-sticky">
<div class="sidebar-about">
<h1>
<a href="/">
<img class="profile-picture" src="/images/avatar.png">
Pierre's website
</a>
</h1>
<p class="lead"></p>
<p class="lead">I'm a software engineer.<br />I like to write code slowly but with agility and to test new tools. <br />This website was crafted with the assistance of <a href='http://getpelican.com/'>Pelican</a> and <a href='https://github.com/jvanz/pelican-hyde'>Hyde</a>. </p>
<p></p>
</div>
<ul class="sidebar-nav">
</ul>
<nav class="sidebar-social">
<a class="sidebar-social-item" href="https://stackoverflow.com/users/4596254/pierre/" target="_blank">
<i class="fa fa-stack-overflow"></i>
</a>
<a class="sidebar-social-item" href="https://github.com/pierrerousseau/" target="_blank">
<i class="fa fa-github"></i>
</a>
<a class="sidebar-social-item" href="https://news.ycombinator.com/user?id=proussea" target="_blank">
<i class="fa fa-hacker-news"></i>
</a>
<a class="sidebar-social-item" href="https://fr.linkedin.com/in/rousseaupierre/en" target="_blank">
<i class="fa fa-linkedin"></i>
</a>
<a class="sidebar-social-item" href="/">
<i class="fa fa-rss"></i>
</a>
</nav>
</div>
</div> <div class="content container">
<div class="post">
<h1 class="post-title">Simple JavaScript Inheritance by John Resig, 2008</h1>
<span class="post-date">lun. 15 décembre 2014</span>
<h2>Links</h2>
<p><a href="http://ejohn.org/blog/simple-javascript-inheritance/">Simple JavaScript Inheritance</a> by <a href="http://ejohn.org/">John Resig</a>, 2008.</p>
<h2>Abstract (from article introduction)</h2>
<p>I’ve been doing a lot of work, lately, with JavaScript inheritance – namely for my work-in-progress JavaScript book – and in doing so have examined a number of different JavaScript classical-inheritance-simulating techniques. Out of all the ones that I’ve looked at I think my favorites were the implementations employed by base2 and Prototype.</p>
<p>I wanted to go about extracting the soul of these techniques into a simple, re-usable, form that could be easily understood and didn’t have any dependencies. Additionally I wanted the result to be simple and highly usable.</p>
<h2>Personnal opinion</h2>
<p>In this article John Resig gives and comments a source code implementing inheritance in JavaScript. It would have been interesting to have his view on other inheritance technics and to know why he has chosen to present this one. However the code is simple and well explained. In addition to the main subject, I think the implementation of super is one of the most brilliant example of closure I ever seen : it’s simple and powerful, understand it, and you’ll understand closures.</p>
<span class="post-tags">
<ul>
<li><a href="/tag/link.html">link</a></li>
<li><a href="/tag/article.html">article</a></li>
<li><a href="/tag/javascript.html">javascript</a></li>
<li><a href="/tag/closure.html">closure</a></li>
<li><a href="/tag/inheritance.html">inheritance</a></li>
</ul>
</span>
</div>
</div>
</body>
</html>