Bro-Coding 101

Learn the ancient art of Bro-Coding, the art of writing arrays in the most efficient way possible, while still being cool.

Lesson Plan

Bro-Arrays for Bros | Bro-Slicing for Slaying | Bro-Sorting for Bros

Arrays are like, super cool, right? They're like, a list of items that you can access and manipulate like it's nobody's business. But, like, have you ever wondered how to use them in the most epic way possible?

Bro-Tips

Use var x = [1, 2, 3, 4, 5]; to initialize an array with some basic values, bro.

Access the first item in the array with x[0];, bro.

Use x.push(6); to add more items to the array, like a boss.

Sort the array with x.sort(function(a, b) { return b - a; }); for maximum efficiency, bro.

Learn more about Bro-Arrays for Bros