7 kyu

Format With

263 of 264joh_pot

Description:

Write

String.prototype.formatWith = function () {}

that takes in a list of arguments and formats the string based off these arguments and indices.

For example:

'Hello {0}'.formatWith('Codewars') ===  'Hello Codewars'
'{0} + {0} = {1}'.formatWith('1','2') ===  '1 + 1 = 2'
'Testing {1}'.formatWith('kata') === 'Testing {1}' // there is no arguments at position 1
Strings
Fundamentals

Stats:

CreatedFeb 2, 2017
PublishedFeb 2, 2017
Warriors Trained619
Total Skips6
Total Code Submissions769
Total Times Completed264
JavaScript Completions263
Total Stars11
% of votes with a positive feedback rating94% of 104
Total "Very Satisfied" Votes93
Total "Somewhat Satisfied" Votes9
Total "Not Satisfied" Votes2
Total Rank Assessments11
Average Assessed Rank
6 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • joh_pot Avatar
  • donaldsebleung Avatar
Ad