Skip to content

Commit 4eed476

Browse files
committed
Add 'reading documentation'
1 parent 226e612 commit 4eed476

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

reading-documentation.html

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<head>
2+
<title>Reading Documentation</title>
3+
<style>
4+
body {
5+
font-family: sans-serif;
6+
line-height: 1.5;
7+
margin: 40px auto;
8+
max-width: 640px;
9+
}
10+
</style>
11+
</head>
12+
<body>
13+
<h1>Reading Documentation</h1>
14+
<p>
15+
<small>
16+
<a href='/'>This is documentation for reading JavaScript documentation
17+
generated by documentation.js</a>
18+
</small>
19+
</p>
20+
<p>
21+
How do you read API documentation?
22+
</p>
23+
<p>
24+
Compared to answers, examples, or narrative documentation, API documentation
25+
can be an intimidating read: it's much more like an Encylopedia than a novel.
26+
</p>
27+
<h4>Understanding the types of things</h4>
28+
<p>
29+
API documentation will have a few explicit classes of things that are documented.
30+
Here are some distinctions that aren't always laid out in other kinds
31+
of documentation:
32+
</p>
33+
34+
<ul>
35+
<li><strong>instance</strong> methods will usually be denoted with the #
36+
symbol in API documentation. These are methods that you <em>call on an instance of an object</em>.
37+
For instance, in native JavaScript, strings have a <em>.toUpperCase()</em>
38+
method. You don't call this method on the String type, but you call it
39+
on a specific string: like you can write
40+
<code>var yelling = 'hi'.toUpperCase()</code>
41+
Remember that, though documentation uses the # character to show what's an
42+
instance method, you don't actually use that symbol in your source code.
43+
</li>
44+
<li><strong>static</strong> methods instead are called on objects or classes
45+
without needing to instantiate anything. Usually in documentation, static
46+
methods are denoated with a '.' The <code>fromCharCode</code>
47+
method of strings is an example of this: it'll be documented as a static
48+
method and called like <code>String.fromCharCode(20)</code>. Notice
49+
that we're not calling this on a specific string, but the String
50+
class itself.
51+
</li>
52+
</ul>
53+
</body>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy