Extensions: Why does String.format() work



Hello list,

while browsing some of the existing GNOME-Shell extensions source [1]
noticed string formating similiar to C or python:
``'some_random_string'.format()``.
I'm not really that familiar with JS but by all accounts ([2], [3], [4])
javascript does not have build in string formating.
So my question is, is there some additional magic happening when JS is
parsed for extensions? Why does this work? Did I miss something?

Thank you for your time
Eric.

[1]
https://git.gnome.org/browse/gnome-shell-extensions/tree/extensions/drive-menu/extension.js#n106
[2]
http://stackoverflow.com/questions/610406/javascript-equivalent-to-printf-string-format
[3]
http://stackoverflow.com/questions/18405736/is-there-a-c-sharp-string-format-equivalent-in-javascript
[4]
https://developer.mozilla.org/de/docs/Web/JavaScript/Guide/Text_formatting



Attachment: signature.asc
Description: OpenPGP digital signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]