Skip to content

Instantly share code, notes, and snippets.

@MickeyKay
Last active April 1, 2018 03:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MickeyKay/c61c506e8d1f2dd3104c2839c5db10eb to your computer and use it in GitHub Desktop.
Save MickeyKay/c61c506e8d1f2dd3104c2839c5db10eb to your computer and use it in GitHub Desktop.
Nested for loop example (not so great)
var list = ['some', 'huge', 'array', '...'];
function reverseAndCapitalizeOrLowercase(list) {
list.forEach(function(text) {
// A
// big
// chunk
// of
// code
// that
// alphabetizes
// text
if (text.length > 3) {
// A
// big
// chunk
// of
// code
// that
// capitalizes
// text
} else {
// A
// big
// chunk
// of
// code
// that
// lowercases
// text
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment