Skip to content

Commit c1a4802

Browse files
committed
Removed <mark> highlights fixing bevacqua#2
1 parent f5fbf35 commit c1a4802

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

readme.markdown

+15-15
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Apologies about that long table of contents, and here we go.
8484
- Assign default values like `function foo (bar=2) {}`
8585
- Those defaults can be objects, too `function foo (bar={ a: 1, b: 2 }) {}`
8686
- Destructure `bar` completely, like `function foo ({ a=1, b=2 }) {}`
87-
- Default to an empty object if nothing is provided, like `function foo ({ a=1, b=2 } <mark>= {}</mark>) {}`
87+
- Default to an empty object if nothing is provided, like `function foo ({ a=1, b=2 } = {}) {}`
8888
- Read [ES6 JavaScript Destructuring in Depth][3]
8989

9090
<sup>[(back to table of contents)](#table-of-contents)</sup>
@@ -147,7 +147,7 @@ Apologies about that long table of contents, and here we go.
147147
# Object Literals
148148

149149
- Instead of `{ foo: foo }`, you can just do `{ foo }` -- known as a _property value shorthand_
150-
- Computed property names, `{ <mark>[prefix + 'Foo']</mark>: 'bar' }`, where `prefix: 'moz'`, yields `{ mozFoo: 'bar' }`
150+
- Computed property names, `{ [prefix + 'Foo']: 'bar' }`, where `prefix: 'moz'`, yields `{ mozFoo: 'bar' }`
151151
- You can't combine computed property names and property value shorthands, `{ [foo] }` is invalid
152152
- Method definitions in an object literal can be declared using an alternative, more terse syntax, `{ foo () {} }`
153153
- See also [`Object`](#object) section
@@ -160,9 +160,9 @@ Apologies about that long table of contents, and here we go.
160160
- Not _"traditional"_ classes, syntax sugar on top of prototypal inheritance
161161
- Syntax similar to declaring objects, `class Foo {}`
162162
- Instance methods _-- `new Foo().bar` --_ are declared using the short [object literal](#object-literals) syntax, `class Foo { bar () {} }`
163-
- Static methods _-- `Foo.isPonyFoo()` --_ need a `static` keyword prefix, `class Foo { <mark>static</mark> isPonyFoo () {} }`
163+
- Static methods _-- `Foo.isPonyFoo()` --_ need a `static` keyword prefix, `class Foo { static isPonyFoo () {} }`
164164
- Constructor method `class Foo { constructor () { /* initialize instance */ } }`
165-
- Prototypal inheritance with a simple syntax `class PonyFoo <mark>extends</mark> Foo {}`
165+
- Prototypal inheritance with a simple syntax `class PonyFoo extends Foo {}`
166166
- Read [ES6 Classes in Depth][8]
167167

168168
<sup>[(back to table of contents)](#table-of-contents)</sup>
@@ -186,7 +186,7 @@ Apologies about that long table of contents, and here we go.
186186
- Declaration of a variable by the same name will throw
187187
- Meant to fix mistakes where you reassign a variable and lose a reference that was passed along somewhere else
188188
- In ES6, **functions are block scoped**
189-
- Prevents leaking block-scoped secrets through hoisting, `{ <mark>let</mark> _foo = 'secret', bar = <mark>() => _foo</mark>; }`
189+
- Prevents leaking block-scoped secrets through hoisting, `{ let _foo = 'secret', bar = () => _foo; }`
190190
- Doesn't break user code in most situations, and typically what you wanted anyways
191191
- Read [ES6 Let, Const and the “Temporal Dead Zone” (TDZ) in Depth][9]
192192

@@ -196,7 +196,7 @@ Apologies about that long table of contents, and here we go.
196196

197197
- A new primitive type in ES6
198198
- You can create your own symbols using `var symbol = Symbol()`
199-
- You can add a description for debugging purposes, like `Symbol(<mark>'ponyfoo'</mark>)`
199+
- You can add a description for debugging purposes, like `Symbol('ponyfoo')`
200200
- Symbols are immutable and unique. `Symbol()`, `Symbol()`, `Symbol('foo')` and `Symbol('foo')` are all different
201201
- Symbols are of type `symbol`, thus: `typeof Symbol() === 'symbol'`
202202
- You can also create global symbols with `Symbol.for(key)`
@@ -224,7 +224,7 @@ Apologies about that long table of contents, and here we go.
224224

225225
- Iterator and iterable protocol define how to iterate over any object, not just arrays and array-likes
226226
- A well-known `Symbol` is used to assign an iterator to any object
227-
- `var foo = { [<mark>Symbol.iterator</mark>]: iterable}`, or `foo[<mark>Symbol.iterator</mark>] = iterable`
227+
- `var foo = { [Symbol.iterator]: iterable}`, or `foo[Symbol.iterator] = iterable`
228228
- The `iterable` is a method that returns an `iterator` object that has a `next` method
229229
- The `next` method returns objects with two properties, `value` and `done`
230230
- The `value` property indicates the current value in the sequence being iterated
@@ -242,7 +242,7 @@ Apologies about that long table of contents, and here we go.
242242

243243
# Generators
244244

245-
- Generator functions are a special kind of _iterator_ that can be declared using the `<mark>function*</mark> generator () {}` syntax
245+
- Generator functions are a special kind of _iterator_ that can be declared using the `function* generator () {}` syntax
246246
- Generator functions use `yield` to emit an element sequence
247247
- Generator functions can also use `yield*` to delegate to another generator function _-- or any iterable object_
248248
- Generator functions return a generator object that's adheres to both the _iterable_ and _iterator_ protocols
@@ -268,7 +268,7 @@ Apologies about that long table of contents, and here we go.
268268

269269
- Follows the [`Promises/A+`][35] specification, was widely implemented in the wild before ES6 was standarized _(e.g [`bluebird`][34])_
270270
- Promises behave like a tree. Add branches with `p.then(handler)` and `p.catch(handler)`
271-
- Create new `p` promises with `new Promise(<mark>(resolve, reject) => { /* resolver */ }</mark>)`
271+
- Create new `p` promises with `new Promise((resolve, reject) => { /* resolver */ })`
272272
- The `resolve(value)` callback will fulfill the promise with the provided `value`
273273
- The `reject(reason)` callback will reject `p` with a `reason` error
274274
- You can call those methods asynchronously, blocking deeper branches of the promise tree
@@ -347,7 +347,7 @@ Apologies about that long table of contents, and here we go.
347347
- Handlers are also known as traps, these terms are used interchangeably
348348
- You can create **revocable** proxies with `Proxy.revocable(target, handler)`
349349
- That method returns an object with `proxy` and `revoke` properties
350-
- You could [destructure](#destructuring) `var <mark>{proxy, revoke}</mark> = Proxy.revocable(target, handler)` for convenience
350+
- You could [destructure](#destructuring) `var {proxy, revoke} = Proxy.revocable(target, handler)` for convenience
351351
- You can configure the `proxy` all the same as with `new Proxy(target, handler)`
352352
- After `revoke()` is called, the `proxy` will **throw** on _any operation_, making it convenient when you can't trust consumers
353353
- [`get`](https://ponyfoo.com/articles/es6-proxies-in-depth#get) -- traps `proxy.prop` and `proxy['prop']`
@@ -468,16 +468,16 @@ Apologies about that long table of contents, and here we go.
468468
- [`export var foo = 'bar'`](https://ponyfoo.com/articles/es6-modules-in-depth#named-exports) exports a named binding
469469
- Named exports are bindings that [can be changed](https://ponyfoo.com/articles/es6-modules-in-depth#bindings-not-values) at any time from the module that's exporting them
470470
- `export { foo, bar }` exports [a list of named exports](https://ponyfoo.com/articles/es6-modules-in-depth#exporting-lists)
471-
- `export { foo <mark>as ponyfoo</mark> }` aliases the export to be referenced as `ponyfoo` instead
472-
- `export { foo <mark>as default</mark> }` marks the named export as the default export
471+
- `export { foo as ponyfoo }` aliases the export to be referenced as `ponyfoo` instead
472+
- `export { foo as default }` marks the named export as the default export
473473
- As [a best practice](https://ponyfoo.com/articles/es6-modules-in-depth#best-practices-and-export), `export default api` at the end of all your modules, where `api` is an object, avoids confusion
474474
- Module loading is implementation-specific, allows interoperation with CommonJS
475475
- [`import 'foo'`](https://ponyfoo.com/articles/es6-modules-in-depth#import) loads the `foo` module into the current module
476-
- [`import <mark>foo from</mark> 'ponyfoo'`](https://ponyfoo.com/articles/es6-modules-in-depth#importing-default-exports) assigns the default export of `ponyfoo` to a local `foo` variable
476+
- [`import foo from 'ponyfoo'`](https://ponyfoo.com/articles/es6-modules-in-depth#importing-default-exports) assigns the default export of `ponyfoo` to a local `foo` variable
477477
- [`import {foo, bar} from 'baz'`](https://ponyfoo.com/articles/es6-modules-in-depth#importing-named-exports) imports named exports `foo` and `bar` from the `baz` module
478-
- `import {foo <mark>as bar</mark>} from 'baz'` imports named export `foo` but aliased as a `bar` variable
478+
- `import {foo as bar} from 'baz'` imports named export `foo` but aliased as a `bar` variable
479479
- `import {default} from 'foo'` also imports the default export
480-
- `import {default <mark>as bar</mark>} from 'foo'` imports the default export aliased as `bar`
480+
- `import {default as bar} from 'foo'` imports the default export aliased as `bar`
481481
- `import foo, {bar, baz} from 'foo'` mixes default `foo` with named exports `bar` and `baz` in one declaration
482482
- [`import * as foo from 'foo'`](https://ponyfoo.com/articles/es6-modules-in-depth#import-all-the-things) imports the namespace object
483483
- Contains all named exports in `foo[name]`

0 commit comments

Comments
 (0)