<commit_before>// Anonymous function assigned to a variable

var triple = function(x) {
  return x * 3
}

var waffle = triple

waffle(30)

var animals = [
  { name: 'Fluffy', species: 'rabbit' },
  { name: 'Caro', species: 'dog' },
  { name: 'Hamilton', species: 'dog' },
  { name: 'Harold', species: 'fish' },
]

// Functions are values

// var dogs = []

// for (var i = 0; i < animals.length; i++) {
//     if (animals[i].species === 'dog') {
//         dogs.push(animals[i].name)
//     }
// }

// var isDog = function(animal) {
//     return animal.species === 'dogs'
// }

// Filter expect the CallBack function return true or false value
// determining whether or not the item should be included
// into the array or not 

// var dogs = animals.filter(isDog)

// Map will include all items in the array but insted it expects
// the callbak function to return a transformed object that it will
// put into the new array instead of the original one

var names = aniomals.map(function(animal){
  return animal.name
})

console.log(dogs)<commit_msg>[ADD] Arrows<commit_after>// Anonymous function assigned to a variable

var triple = function(x) {
  return x * 3
}

var waffle = triple

waffle(30)

var animals = [
  { name: 'Fluffy', species: 'rabbit' },
  { name: 'Caro', species: 'dog' },
  { name: 'Hamilton', species: 'dog' },
  { name: 'Harold', species: 'fish' },
]

// Functions are values

// var dogs = []

// for (var i = 0; i < animals.length; i++) {
//     if (animals[i].species === 'dog') {
//         dogs.push(animals[i].name)
//     }
// }

// var isDog = function(animal) {
//     return animal.species === 'dogs'
// }

// Filter expect the CallBack function return true or false value
// determining whether or not the item should be included
// into the array or not 

// var dogs = animals.filter(isDog)

// Map will include all items in the array but insted it expects
// the callbak function to return a transformed object that it will
// put into the new array instead of the original one

var names = animals.map(animal => animal.name)

console.log(names)
{'fraction_non_alphanumeric': 0.14395393474088292, 'fraction_numerical': 0.003838771593090211, 'mean_word_length': 2.9866156787762907, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1086170', 'n_tokens_mistral': 690, 'n_tokens_neox': 655, 'n_words': 245}