This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function textNormalizer(text) { | |
| return(`${text}`.toLowerCase().trim()); | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function isDivisible(divisee, divisor) { | |
| return (divisee % divisor === 0); | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function divisibleBy5(array) { | |
| return array.find(function(num) { | |
| return num % 5 === 0; | |
| }); | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function fizzBuzz(countTo) { | |
| const result = []; | |
| for (let i = 1; i <= countTo; i++) { | |
| if (i % 15 === 0) { | |
| result.push('fizzbuzz'); | |
| } | |
| if (i % 5 === 0) { | |
| result.push('buzz'); | |
| } | |
| if (i % 3 === 0) { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Scope refers to how a certain piece of information can be accessed by a computer when executing a program. | |
| In general, scopes can be categorized as being either local or global in nature. If a variable's scope is local, than | |
| it can only be accessed within the function that it was initially declared and will be unavailable to outside functions | |
| or variables. By contrast, a gloabl varialble is avaiable to all parts of a program and can be accessed, and potentially altered | |
| by all of the functions running within the program. | |
| Global variables should be avoided because they can lead to unforeseen consequences. For instance, a result from a function that | |
| is executed may alter the value of a global variable with this new, unexpected value being used by functions called later. Thus an | |
| improperly scoped variable may lead to unintended results. | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function createMyObject() { | |
| const myObject = { foo: 'bar', | |
| answerToUniverse: 42, | |
| 'olly olly': 'oxen free', | |
| sayHello: function(){ | |
| return "hello";} | |
| }; | |
| return myObject; | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function makeStudentsReport(data) { | |
| const result = []; | |
| data.forEach(data => result.push(`${data.name}: ${data.grade}`)); | |
| console.log(result); | |
| return result; | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | The first thing the progrm does is process the raw string and removes all special characrters. | |
| It then returns a raw string that is passed into the const words as text. | |
| wordFrequency is initialized as an empty object and a for loop is started that will loop through the text word by word. | |
| If the word is already in the word frequency object, it will increment by 1. If it is not, it will add it and assign | |
| a value of 1 to it. It will then increment the counter by 1. | |
| After the loop is finished, the program will initializes values for currentMaxKey to the key of the object wordFrequency | |
| and set its index to 0. | |
| currentMaxCount is set to the value of the object wordFrequency at the current index set by the currentMaxKey. | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | $('#number-chooser').on('click', function(event) { | |
| event.preventDefault(); | |
| $(".js-results").empty(); | |
| const num = parseInt( $(event.currentTarget).find('input[name="number-choice"]').val()); | |
| for(let i =1; i<= num; i++){ | |
| if( i % 3 === 0 && i % 5 === 0){ | |
| $(".js-results").append('<div class="fizz-buzz-item fizzbuzz"><span>fizzbuzz</span></div>'); | |
| }else if( i % 3 ===0){ | |
| $(".js-results").append('<div class="fizz-buzz-item fizz"><span>fizz</span></div>'); | |
| }else if (i % 5 ===0){ | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | $(function() { | |
| $( "#js-shopping-list-form" ).submit(function( event ) { | |
| const item = $("#js-shopping-list-form input[name= shopping-list-entry]").val(); | |
| $('.shopping-list').append( | |
| $('<li>').append( | |
| $(`<span class="shopping-item">${item}</span>`).append( | |
| $('<div class="shopping-item-controls">').append($('<button class= "shopping-item-toggle"><span class= "button-label">check</span></button><button class="shopping-item-delete"><span class="button-label">delete</span></button>') | |
| )))); | |
| event.preventDefault(); | 
OlderNewer