function chirp(numberOfSignals){
let signal = ''
for(let i = 0; i < numberOfSignals; i ++) {
if(signal === '') {
signal += 'chirp'
} else {
signal += '-chirp'
}
}
return signal
}
console.log(chirp(4)) //chirp-chirp-chirp-chirp
console.log(chirp(5)) //chirp-chirp-chirp-chirp-chirp
`
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.
None recursive javascript solution
`