What are useful JavaScript methods that extends built-in objects?
<p>What are your most useful, most practical methods that extends built-in JavaScript objects like String, Array, Date, Boolean, Math, etc.?</p>

<p><strong>String</strong></p>

<ul>
<li><a href="http://stackoverflow.com/questions/1137436/useful-javascript-methods-that-extends-built-in-objects/1141475#1141475">format</a> </li>
<li><a href="http://stackoverflow.com/questions/1137436/useful-javascript-methods-that-extends-built-in-objects/1141469#1141469">trim</a></li>
<li><a href="http://stackoverflow.com/questions/1137436/useful-javascript-methods-that-extends-built-in-objects/1137468#1137468">padding</a></li>
<li><a href="http://stackoverflow.com/questions/1137436/useful-javascript-methods-that-extends-built-in-objects/1137579#1137579">replaceAll</a> &amp; <a href="http://stackoverflow.com/questions/1137436/useful-javascript-methods-that-extends-built-in-objects/1141816#1141816">replaceAll</a></li>
</ul>

<p><strong>Array</strong></p>

<ul>
<li><a href="http://stackoverflow.com/questions/1137436/useful-javascript-methods-that-extends-built-in-objects/1137481#1137481">indexOf</a></li>
</ul>

<p><strong>Date</strong></p>

<ul>
<li><a href="http://stackoverflow.com/questions/1137436/useful-javascript-methods-that-extends-built-in-objects/1140330#1140330">toMidnight</a></li>
</ul>

<p><strong>Note :</strong> Please post one extended method per answer.</p>
