Ad

you will be given a sentence and a set of letters the program should test for the amount of letters in the sentence

EXAMPLE: sentence: "only one z and two w's" letters: ["z","w"] expected: [1,2]

function testAmount(sentence,letters){
 var a=[];
 for(var i=0;i<letters.length;i++){
     a.push(0);
   for(var j=0;j<sentence.length;j++){
     if(sentence[j] == letters[i]){
       a[i]++;
     }
   }
 }
 return a;
}