Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf55da86

Browse files
authored
Merge pull request#17 from keis/patch-1
Drop plural from count variable
2 parents6558fc8 +aa3ee7d commitf55da86

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

‎README.md‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ const pages_count = 5
5151
constshouldUpdate=true
5252

5353
/* Good*/
54-
constpagesCount=5
54+
constpageCount=5
5555
constshouldUpdate=true
5656

5757
/* Good as well*/
58-
constpages_count=5
58+
constpage_count=5
5959
constshould_update=true
6060
```
6161

@@ -70,13 +70,13 @@ A name must be _short_, _intuitive_ and _descriptive_:
7070
```js
7171
/* Bad*/
7272
consta=5// "a" could mean anything
73-
constisPaginatable=postsCount>10// "Paginatable" sounds extremely unnatural
74-
constshouldPaginatize=postsCount>10// Made up verbs are so much fun!
73+
constisPaginatable=a>10// "Paginatable" sounds extremely unnatural
74+
constshouldPaginatize=a>10// Made up verbs are so much fun!
7575

7676
/* Good*/
77-
constpostsCount=5
78-
consthasPagination=postsCount>10
79-
constshouldDisplayPagination=postsCount>10// alternatively
77+
constpostCount=5
78+
consthasPagination=postCount>10
79+
constshouldDisplayPagination=postCount>10// alternatively
8080
```
8181

8282
##Avoid contractions
@@ -111,11 +111,11 @@ A name should reflect the expected result.
111111

112112
```jsx
113113
/* Bad*/
114-
constisEnabled=itemsCount>3
114+
constisEnabled=itemCount>3
115115
return<Button disabled={!isEnabled}/>
116116

117117
/* Good*/
118-
constisDisabled=itemsCount<=3
118+
constisDisabled=itemCount<=3
119119
return<Button disabled={isDisabled}/>
120120
```
121121

@@ -154,7 +154,7 @@ The verb part of your function name. The most important part responsible for des
154154
Accesses data immediately (i.e. shorthand getter of internal data).
155155

156156
```js
157-
functiongetFruitsCount() {
157+
functiongetFruitCount() {
158158
returnthis.fruits.length
159159
}
160160
```

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp