-
Notifications
You must be signed in to change notification settings - Fork 22.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove sup
from javascript docs
#5128
Conversation
@@ -11,7 +11,7 @@ | |||
|
|||
<h2 id="What_is_JavaScript">What is JavaScript?</h2> | |||
|
|||
<p><strong>JavaScript</strong><sup>®</sup> (often shortened to <strong>JS</strong>) is a lightweight, interpreted, object-oriented language with <a href="https://en.wikipedia.org/wiki/First-class_function">first-class functions</a>, and is best known as the scripting language for Web pages, but it's <a href="https://en.wikipedia.org/wiki/JavaScript#Uses_outside_Web_pages">used in many non-browser environments</a> as well. It is a <a class="mw-redirect" href="https://en.wikipedia.org/wiki/Prototype-based_programming" title="Prototype-based">prototype-based</a>, multi-paradigm scripting language that is dynamic, and supports object-oriented, imperative, and functional programming styles.</p> | |||
<p><strong>JavaScript</strong> (often shortened to <strong>JS</strong>) is a lightweight, interpreted, object-oriented language with <a href="https://en.wikipedia.org/wiki/First-class_function">first-class functions</a>, and is best known as the scripting language for Web pages, but it's <a href="https://en.wikipedia.org/wiki/JavaScript#Uses_outside_Web_pages">used in many non-browser environments</a> as well. It is a <a class="mw-redirect" href="https://en.wikipedia.org/wiki/Prototype-based_programming" title="Prototype-based">prototype-based</a>, multi-paradigm scripting language that is dynamic, and supports object-oriented, imperative, and functional programming styles.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am assuming that since I've not seen it before on MDN we don't generally markup the use of trademarks, copyrights etc. If so, good.
@@ -377,31 +377,31 @@ <h3 id="Indexed_collections_Arrays_and_typed_Arrays">Indexed collections: Arrays | |||
</tr> | |||
<tr> | |||
<td>{{jsxref("Float32Array")}}</td> | |||
<td><code>1.2</code>×<code>10<sup>-38</sup></code> to <code>3.4</code>×<code>10<sup>38</sup></code></td> | |||
<td><code>1.2</code>×<code>10^-38</code> to <code>3.4</code>×<code>10^38</code></td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be better for base 10 exponentials to represent using E, as this is well understood (even by me): E.g.1.2
×10^-38
to 1.2E-38
<td>4</td> | ||
<td>32-bit IEEE floating point number (7 significant digits e.g., <code>1.1234567</code>)</td> | ||
<td><code>unrestricted float</code></td> | ||
<td><code>float</code></td> | ||
</tr> | ||
<tr> | ||
<td>{{jsxref("Float64Array")}}</td> | ||
<td><code>5.0</code>×<code>10<sup>-324</sup></code> to <code>1.8</code>×<code>10<sup>308</sup></code></td> | ||
<td><code>5.0</code>×<code>10^-324</code> to <code>1.8</code>×<code>10^308</code></td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use E? https://github.com/mdn/content/pull/5128/files#r636583402
I won't mark up any more of these.
@@ -23,23 +23,23 @@ | |||
<th colspan="4">Current editions</th> | |||
</tr> | |||
<tr> | |||
<td>ECMA-262 11<sup>th</sup> Edition</td> | |||
<td>ECMA-262 eleventh Edition</td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why, but it feels like eleventh should be capitalised or edition should not be. My preference: "ECMA-262 (eleventh edition)"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually my preference is: ECMA-262 11th Edition.
I don't care that the sub is missing, it just looks better.
<td> | ||
<p><a href="https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf">PDF</a>, <a href="https://ecma-international.org/ecma-262/11.0/index.html">HTML</a>, <a href="https://tc39.github.io/ecma262/">Working draft</a>, <a href="https://github.com/tc39/ecma262">repository</a></p> | ||
</td> | ||
<td>2020</td> | ||
<td>ECMAScript 2020 Language Specification</td> | ||
</tr> | ||
<tr> | ||
<td>ECMA-262 10<sup>th</sup> Edition</td> | ||
<td>ECMA-262 tenth Edition</td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for https://github.com/mdn/content/pull/5128/files#r636584266 - just looks wrong to have the case go up and down. Ignore if you want.
|
||
<pre class="brush: js">var namelistA = new Array(4294967296); //2 to the 32nd power<sup> = </sup>4294967296 | ||
<pre class="brush: js">var namelistA = new Array(4294967296); //2 to the 32nd power = 4294967296 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just want to point out that we're happy to have "32nd" here. I think using first is better, but I would not be offended by 1st, 2nd, etc.
@@ -33,7 +33,7 @@ <h3 id="Parameters">Parameters</h3> | |||
<h3 id="Returns">Returns</h3> | |||
|
|||
<p>The value of <code><var>bigint</var></code> modulo | |||
2<sup><code><var>bits</var></code></sup>, as an unsigned integer.</p> | |||
2^<code><var>bits</var></code>, as an unsigned integer.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix is OK, but would have killed the <var>
markup too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will go in the Markdown conversion (there are a billion on them).
@@ -75,7 +75,7 @@ <h2 id="Static_methods">Static methods</h2> | |||
<dt>{{jsxref("Global_Objects/Math/cosh", "Math.cosh(<var>x</var>)")}}</dt> | |||
<dd>Returns the hyperbolic cosine of <code><var>x</var></code>.</dd> | |||
<dt>{{jsxref("Global_Objects/Math/exp", "Math.exp(<var>x</var>)")}}</dt> | |||
<dd>Returns <code>E<var><sup>x</sup></var></code>, where <code><var>x</var></code> is the argument, and <code>E</code> is Euler's constant (<code>2.718</code>…, the base of the natural logarithm).</dd> | |||
<dd>Returns <code>E<var>^x</var></code>, where <code><var>x</var></code> is the argument, and <code>E</code> is Euler's constant (<code>2.718</code>…, the base of the natural logarithm).</dd> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e
not E
is symbol for Euler's constant. It wouldn't matter, except that using E for base10 exponential is desirable IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PS My be mentioned in a few other cases too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job.
Summarizing the other comments, IMO OK as is, but slightly better if:
- Use E for base 10 exponentials - e.g. 1.2E56.
- Use 1st, 2nd, etc when referring to JavaScript editions.
Thanks for the review @hamishwillee ! I agree about the "1st" thing, and I've updated to use E notation as well, though |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, looks good to me. I've approved so you can self merge if you like, or wait for @sideshowbarker to also have a go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautiful
files/en-us/web/javascript/guide/control_flow_and_error_handling/index.html
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/errors/resulting_string_too_large/index.html
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/array/array/index.html
Outdated
Show resolved
Hide resolved
Thanks both for your sharp eyes! |
As discussed in #4578 and in particular #4578 (comment), I've gone through the JS docs, replacing
<sup>
with caret, or the ordinal word like "first", and in one case removing it entirely.One case that needed care is
2<sup>63</sup>-1
, which renders like:263-1
...but gives the less readable (to my eye)
2^63-1
...when converted. Many of these already used spaces:
263 - 1
...but I've tried to make sure that they all do, so we get:
2^63 - 1
...which looks better to me.