Skip to content

Instantly share code, notes, and snippets.

@piqueen314 piqueen314/gist6
Created Dec 11, 2015

What would you like to do?
Repeat a given string (first argument) n times (second argument). Return an empty string if n is a negative number.
// Bonfire: Repeat a string repeat a string
// Author: @piqueen314
// Challenge:
// Learn to Code at Free Code Camp (
function repeat(str, num) {
// repeat after me
var newStr="";
for(var i=0; i<num; i++){
return newStr;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.