This is the reference point. All the other options are based off this.
|-- app
| |-- controllers
| | |-- admin
var data = x ? y ? z ? z : y : x : 0; | |
// I call this the "if..if" pattern, and it's BAD. It means: | |
var data; | |
if (x) { | |
if (y) { | |
if (z) { | |
data = z; | |
} |
/** | |
* Sort array of objects based on another array | |
*/ | |
function mapOrder (array, order, key) { | |
array.sort( function (a, b) { | |
var A = a[key], B = b[key]; | |
While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.
Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.