<commit_before>/*Input: An integer
Output: That integer expressed as a string with commas in appropriate spots

Steps:
CONVERT integer to string
REVERSE string
SPLIT string into array of single chars
GROUP chars into sub-arrays of three chars each
  FOR loop
    SPLICE groups of three chars
    INSERT into
JOIN arrays of three into a single string
REVERSE string
RETURN string

*/
//Initial:
// function separateComma(integer){
//   var numbers = integer.toString().split("");
//   var reverseNum = numbers.reverse();
  
//   for(var counter = 3; counter < reverseNum.length ; counter += 4){
//     reverseNum.splice(counter,0,",");
//   };
  
//   var output = reverseNum.reverse().join("");
//   return output;

// };

Refactored:
function separateComma(integer){
  var numString = integer.toString().split("").reverse();
  
  for(var counter = 3; counter < numString.length ; counter += 4) {
    numString.splice(counter,0,",");
  };
  return numString.reverse().join("");
};

console.log(separateComma(1345));
<commit_msg>Adding Other Pair<commit_after>/*Input: An integer
Output: That integer expressed as a string with commas in appropriate spots

Steps:
CONVERT integer to string
REVERSE string
SPLIT string into array of single chars
GROUP chars into sub-arrays of three chars each
  FOR loop
    SPLICE groups of three chars
    INSERT into
JOIN arrays of three into a single string
REVERSE string
RETURN string

****Going to try to use slice after further reading This wasnt my initial solution. Wanted to practice with other functions: function remove(array, index) {
  var separateComma = function(int){
  var string = int.toString().split("").reverse();
  
  if (string.length < 4){
    console.log(string);
  }; 
  var sectionsOfThree = []; 
  var allNums = [];
  var total = "" ;
  while (string.length > 0){
     sectionsOfThree = string.slice(0,3);
     sectionsOfThree = sectionsOfThree.join("");
     string = string.slice(3);
     allNums.push(sectionsOfThree);
     total = allNums.toString().split("").reverse();
     total = total.join("")
  };
     console.log(total);

};
separateComma(1343934588805058)
separateComma(134398)
*/
//Initial:
// function separateComma(integer){
//   var numbers = integer.toString().split("");
//   var reverseNum = numbers.reverse();
  
//   for(var counter = 3; counter < reverseNum.length ; counter += 4){
//     reverseNum.splice(counter,0,",");
//   };
  
//   var output = reverseNum.reverse().join("");
//   return output;

// };

Refactored:
function separateComma(integer){
  var numString = integer.toString().split("").reverse();
  
  for(var counter = 3; counter < numString.length ; counter += 4) {
    numString.splice(counter,0,",");
  };
  return numString.reverse().join("");
};

console.log(separateComma(1345));

{'fraction_non_alphanumeric': 0.13840086052348513, 'fraction_numerical': 0.016851918250268914, 'mean_word_length': 3.7610921501706485, 'pattern_counts': {'":': 0, '<': 8, '<?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': '772945', 'n_tokens_mistral': 877, 'n_tokens_neox': 837, 'n_words': 252}