function infiltrate() { // do something // ... var bulletCount = 10; // do something else // ... var handler = function() { // handle difficult things }; }
Array.prototype.sumOfSquares = function() { // Blazing fast sum of squares code. }; var theNumbers = [4, 8, 15]; for (var i in theNumbers) { console.log(i); }
Array.prototype.sumOfSquares = function() { // Blazing fast sum of squares code. }; var theNumbers = [4, 8, 15]; for (var i in theNumbers) { console.log(i); } > 0 > 1 > 2 > sumOfSquares
const squareNumber = n => n * n; const squareNumber = (n) => n * n; const addNumbers = a, b => a + b; // Error! const addNumbers = (a, b) => a + b; const addNumbers = (a, b) => { return a + b; };