Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eb26427

Browse files
committed
parenthesize arrow function arguments consistently
1 parent 62afdb2 commit eb26427

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ this guide other than this, you'll be ahead of many developers.
244244
**Bad:**
245245
```javascript
246246
function emailClients(clients) {
247-
clients.forEach(client => {
247+
clients.forEach((client) => {
248248
const clientRecord = database.lookup(client);
249249
if (clientRecord.isActive()) {
250250
email(client);
@@ -373,7 +373,7 @@ code eligible for refactoring.
373373
**Bad:**
374374
```javascript
375375
function showDeveloperList(developers) {
376-
developers.forEach(developers => {
376+
developers.forEach((developers) => {
377377
const expectedSalary = developer.calculateExpectedSalary();
378378
const experience = developer.getExperience();
379379
const githubLink = developer.getGithubLink();
@@ -388,7 +388,7 @@ function showDeveloperList(developers) {
388388
}
389389

390390
function showManagerList(managers) {
391-
managers.forEach(manager => {
391+
managers.forEach((manager) => {
392392
const expectedSalary = manager.calculateExpectedSalary();
393393
const experience = manager.getExperience();
394394
const portfolio = manager.getMBAProjects();
@@ -406,7 +406,7 @@ function showManagerList(managers) {
406406
**Good**:
407407
```javascript
408408
function showList(employees) {
409-
employees.forEach(employee => {
409+
employees.forEach((employee) => {
410410
const expectedSalary = employee.calculateExpectedSalary();
411411
const experience = employee.getExperience();
412412

@@ -1817,21 +1817,21 @@ from `try/catch`.
18171817
**Bad:**
18181818
```javascript
18191819
getdata()
1820-
.then(data => {
1820+
.then((data) => {
18211821
functionThatMightThrow(data);
18221822
})
1823-
.catch(error => {
1823+
.catch((error) => {
18241824
console.log(error);
18251825
});
18261826
```
18271827
18281828
**Good:**
18291829
```javascript
18301830
getdata()
1831-
.then(data => {
1831+
.then((data) => {
18321832
functionThatMightThrow(data);
18331833
})
1834-
.catch(error => {
1834+
.catch((error) => {
18351835
// One option (more noisy than console.log):
18361836
console.error(error);
18371837
// Another option:

0 commit comments

Comments
 (0)