<commit_before>'use strict';

var fizzbuzz = function(array) {
  for (var i = 0; i < array.length; i++) {
    if ( i % 15 === 0) {
      return 'fizzbuzz';
    } else if ( i % 3 === 0) {
      return 'fizz';
    } else if ( i % 5 === 0) {
      return 'buzz';
    } else {
      return 'error';
    }
  }
};

var array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];

var array2 = [1, 3, 5, 7, 15, 21, 25, 30];

fizzbuzz(array);

fizzbuzz(array2);<commit_msg>polished the fizzbuzz challenge problem<commit_after>'use strict';

//Write a program that prints all the numbers from 1 to 100. For multiples of 3, instead of the number, print "Fizz", for multiples of 5 print "Buzz". For numbers which are multiples of both 3 and 5, print "FizzBuzz".

var fizzbuzz = function(array) {
  for (var i = 0; i < array.length; i++) {
    if ( array[i] % 15 === 0) {
      console.log('fizzbuzz');
    } else if ( array[i] % 3 === 0) {
      console.log('fizz');
    } else if ( array[i] % 5 === 0) {
      console.log('buzz');
    } else {
      console.log(array[i]);
    }
  }
};

var array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];

fizzbuzz(array);

//checking the value of the index rather than the index itself
var fizzbuzz2 = function(array) {
  for (var i = 0; i < array.length; i++) {
    if ( array[i] % 15 === 0) {
      console.log('fizzbuzz');
    } else if ( array[i] % 3 === 0) {
      console.log('fizz');
    } else if ( array[i] % 5 === 0) {
      console.log('buzz');
    } else {
      console.log(array[i]);
    }
  }
};

var array2 = [1, 3, 5, 7, 15, 21, 25, 30];

fizzbuzz2(array2);
{'fraction_non_alphanumeric': 0.1859888406695598, 'fraction_numerical': 0.06447613143211407, 'mean_word_length': 2.5317286652078774, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5887745', 'n_tokens_mistral': 726, 'n_tokens_neox': 630, 'n_words': 207}