I am a software engineer currently working @ShopPad, previously @HPE. I like to build websites and web application in PHP, JavaScript, and Golang. I have an unhealthy obsession with Mexican food (🌯)
/**
* Daily Challenge #40 - Counting Sheep
*
* @param {number} Number of sheeps.
* @return {string}
*/constcountingSheep=number=>{// Checking if positive integer or not.if(!(number>>>0===parseFloat(number))){return`${number} is not a positive integer`;}lettext='';// Building text.for(leti=1;i<=number;i++){text+=`${i} sheep...`;}returntext;};console.log(countingSheep(3));// Output: 1 sheep...2 sheep...3 sheep...
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
JavaScript