Created
July 24, 2017 16:43
-
-
Save uniquename/76f5d9e1d097dd89ad1ecc8e66feb4cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myArray = ['Apples', 'Bananas', 'Pears', 'Oranges']; | |
/* | |
var myArray = [{ | |
id: 55675, | |
title: 'hey there', | |
body: 'that where really great news!' | |
}, { | |
id: 55676, | |
title: 'oh really?!', | |
body: 'thats nice to hear!!!' | |
}]; | |
*/ | |
//console.log(myArray.length); | |
for (var counter = 0; counter < 5; counter++) { | |
console.log(counter); | |
} | |
/* | |
for (var i = 0; i < myArray.length; i++) { | |
console.log(myArray[i]); | |
} | |
/* | |
myArray.forEach(function(item){ | |
console.log(item); | |
}); | |
var logArrayElements = function (element, index, array) { | |
console.log('a[' + index + '] = ' + element); | |
} | |
myArray.forEach(logArrayElements); | |
*/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment