Skip to content

Bonfire allows use of str.prototype.repeat. #4250

@shadowfool

Description

@shadowfool

Challenge Bonfire: Repeat a string repeat a string has an issue.
User Agent is: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36.
Please describe how to reproduce this issue, and include links to screenshots if possible.

I think this could end up being misleading to beginner programmers who don't realize that repeat is a preexisting function in JS that takes a number as its argument. Is there a way to restrict the use of repeat for this exercise? I think this would be very valuable to have someone create their own repeat function either through loops or recursion.

My code:

function repeat(str, num) {
  if(num < 0){
    return "";
  }
  return str.repeat(num);
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions