Table of contents


Metro 4 objects and types extensions.


Metro 4 contains the number of extensions for standard javascript types and objects.

Object Extension Desc
$.fn toggleAttr(attribute, value) toggle element attribute
$.fn clearClasses() remove all element classes
Array shuffle() Shuffle array elements
Array clone() Clone array
Array unique() Get array unique element
Number format(n, x, s, c) Format number value. n: length of decimal, x: length of whole part, s: sections delimiter, c: decimal delimiter
String capitalize(str) Capitalize string
String contains(substr, index) Check if string contains substring
Date format(format, locale) Format Date object (see this article)
Date addHours(hours) Add hours to date