<commit_before>
/* This defines a function which turns off every light by removing the "on" class from the HTML elements.*/

var TERMS = document.getElementsByClassName("term");

function allOff() {
  for (var i=0; i<TERMS.length; i = i+1) {
    TERMS[i].classList.remove("on");
  }


// switch term has been called! 
function switchTerm(target_class) {
   console.log(target_class); // what was passed in...?
// in this situation target_class is equal to "program"
allOff();
}
  // at this time lets create a list/array containing ONLY the target elements we want to "turn on"
  var target_nodes = document.getElementsByClassName(target_class);// need a way to search HTML page for all elements with className "program"

  // use a for loop to iterate over that sub-list
  // review this link for how to loop over node list...see EXAMPLE section
  // https://developer.mozilla.org/en-US/docs/Web/API/NodeList
 //for ( ...set up the for loop... ) { 
   //   target_node[i].classList.add("on"); // "turn on" each of those nodes!
  for (var i=0; < target_class.length; i ++) ) { 
  target_class[i].classList.add("on"); // "turn on" each of those nodes!
  }

 



<commit_msg>Update lights.js<commit_after>
/* This defines a function which turns off every light by removing the "on" class from the HTML elements.*/

var TERMS = document.getElementsByClassName("term");

function allOff() {
  for (var i=0; i<TERMS.length; i = i+1) {
    TERMS[i].classList.remove("on");
  }


// switch term has been called! 
function switchTerm(target_class) {
   console.log(target_class); // what was passed in...?
// in this situation target_class is equal to "program"
allOff();
}
  // at this time lets create a list/array containing ONLY the target elements we want to "turn on"
  var target_nodes = document.getElementsByClassName(target_class);// need a way to search HTML page for all elements with className "program"

  // use a for loop to iterate over that sub-list
  // review this link for how to loop over node list...see EXAMPLE section
  // https://developer.mozilla.org/en-US/docs/Web/API/NodeList
 //for ( ...set up the for loop... ) { 
   //   target_node[i].classList.add("on"); // "turn on" each of those nodes!
  for (var j=0; j < target_class.length; j ++)  { 
  target_class[j].classList.add("on"); // "turn on" each of those nodes!
  }
}



{'fraction_non_alphanumeric': 0.12989778534923338, 'fraction_numerical': 0.002555366269165247, 'mean_word_length': 3.374301675977654, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '1114712', 'n_tokens_mistral': 739, 'n_tokens_neox': 716, 'n_words': 266}