Skip to content
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

More comments #2630

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ Other Style Guides

## Types

*Explains what types are in Javascript*

Programming languages all have built-in data structures, but these often differ from one language to another. This article attempts to list the built-in data structures available in JavaScript and what properties they have. These can be used to build other data structures. Wherever possible, comparisons with other languages are drawn.

<a name="types--primitives"></a><a name="1.1"></a>
- [1.1](#types--primitives) **Primitives**: When you access a primitive type you work directly on its value.

Expand All @@ -73,6 +77,8 @@ Other Style Guides
- `symbol`
- `bigint`

*Goes over numbers*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems redundant


```javascript
const foo = 1;
let bar = foo;
Expand All @@ -91,6 +97,8 @@ Other Style Guides
- `array`
- `function`

*Goes over arrays*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as does this


```javascript
const foo = [1, 2];
const bar = foo;
Expand All @@ -109,6 +117,8 @@ Other Style Guides

> Why? This ensures that you can’t reassign your references, which can lead to bugs and difficult to comprehend code.

*Vars and Consts*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this


```javascript
// bad
var a = 1;
Expand Down Expand Up @@ -141,6 +151,8 @@ Other Style Guides
<a name="references--block-scope"></a><a name="2.3"></a>
- [2.3](#references--block-scope) Note that both `let` and `const` are block-scoped, whereas `var` is function-scoped.

*Goes over scopes in Javascript*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this


```javascript
// const and let only exist in the blocks they are defined in.
{
Expand All @@ -162,6 +174,8 @@ Other Style Guides
<a name="objects--no-new"></a><a name="3.1"></a>
- [3.1](#objects--no-new) Use the literal syntax for object creation. eslint: [`no-new-object`](https://eslint.org/docs/rules/no-new-object)

*Goes over objects*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this


```javascript
// bad
const item = new Object();
Expand Down
4 changes: 2 additions & 2 deletions react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,10 @@ This style guide is mostly based on the standards that are currently prevalent i
<Foo bar="bar" />

// bad
<Foo style={{ left: "20px" }} />
<Foo className='bad example' />

// good
<Foo style={{ left: '20px' }} />
<Foo className="good example" />
Comment on lines -254 to +257
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these MUST remain as "style" with an object literal; there's nothing wrong with the current examples.

```

## Spacing
Expand Down