The wijmo.format Method
Creating strings based on formatted data can be challenging in JavaScript. ES2016 addressed that limitation by introducing Template Strings.
Unfortunately, browser support is still limited for that solution. Hence, we provide the format function that works regardless of browser. The format function takes a format string with placeholders that contain variable names and format specifiers, and a data object that supplies the variables.
For example:
wijmo.format('Welcome {name}! You have {miles:n0} miles in your account.', { name: 'Joe', miles: 2332123 })
Another example:
wijmo.format('{name}, thanks for being a customer since {date:D}.', { name: 'Joe', date: new Date() })