diff --git a/README.md b/README.md index 2680c19a..48afd4b0 100644 --- a/README.md +++ b/README.md @@ -417,6 +417,45 @@ Other Style Guides **[⬆ back to top](#table-of-contents)** + + - [4.6](#arrays--bracket-newline) Use line breaks after open and before close array brackets if an array has multiple lines + + ```javascript + // bad + const arr = [ + [0, 1], [2, 3], [4, 5], + ]; + + const objectInArray = [{ + id: 1, + }, { + id: 2, + }]; + + const numberInArray = [ + 1, 2, + ]; + + // good + const arr = [[0, 1], [2, 3], [4, 5]]; + + const objectInArray = [ + { + id: 1, + }, + { + id: 2, + }, + ]; + + const numberInArray = [ + 1, + 2, + ]; + ``` + +**[⬆ back to top](#table-of-contents)** + ## Destructuring