Skip to content

Commit 5120543

Browse files
authored
jQuery.trim: Describe differences between String#trim & jQuery.trim
`jQuery.trim` supports non-string arguments while `String#trim` does not. Note these differences. Fixes gh-1174 Closes gh-1175
1 parent 77c9c6d commit 5120543

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

entries/jQuery.trim.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<desc>Remove the whitespace from the beginning and end of a string.</desc>
1111
<longdesc>
1212
<div class="warning">
13-
<p>Note: This API has been deprecated in jQuery 3.5; please use the native <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim"><code>String.prototype.trim</code></a> method instead.</p>
13+
<p>Note: This API has been deprecated in jQuery 3.5; please use the native <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim"><code>String.prototype.trim</code></a> method instead. Unlike <code>jQuery.trim</code>, <code>String.prototype.trim</code> does not work with types other than strings (<code>null</code>, <code>undefined</code>, <code>Number</code>). Make sure that your code is compatible when migrating.</p>
1414
</div>
1515
<p>The <code>$.trim()</code> function removes all newlines, spaces (including non-breaking spaces), and tabs from the beginning and end of the supplied string. If these whitespace characters occur in the middle of the string, they are preserved.</p>
1616
</longdesc>

0 commit comments

Comments
 (0)