Skip to content

chapter01/1.3 - URLify/urlify.js #20

@jarkin13

Description

@jarkin13

For this problem, why wouldn't you do something along the lines of:

var uglify = function(input) {
  input = input.trim();
  var url = input.split(' ').join('%20');
  return url;
}

I know it says that it provides with the true length of the string, but would something a long these lines not be acceptable?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions