Advertisement
tonysamperi

012 - sprintf

Aug 18th, 2022
622
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 0.17 KB | Source Code | 0 0
  1. function sprintf(s, argv) {
  2.     if (typeof s !== typeof "" || !argv.length) {
  3.         return s;
  4.     }
  5.  
  6.     return sprintf(s.replace("%s", `${argv.shift()}`), argv);
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement