Counting sheep outloud in Javascript

Recently, I’ve decided that I need some ******** skillz so now I’ve gone through a process of doing some Kata right before bed time.

This one is for counting sheep. This is for my own development and journal so if you’re going at it own your own, BIG SPOILER ALERT below

eace2bb3908e359c0f591b65ce32b374.jpg

When given a function(3), return a string of “1 sheep…2 sheep…3 sheep…”


var countSheep = function (num){

  //start with a counter i = 1
  // increment i
  // stop until i == num
  // "interpolation" to insert variables
  // return joint array
    let smallArr = "";
    for (let x = 1; x <= num; x++)
    {
       smallArr += `${x} sheep...`
    } 
    return smallArr;
};