Created
November 19, 2014 13:58
-
-
Save shaunwallace/81e9d55556e72f95a3d1 to your computer and use it in GitHub Desktop.
String.prototype.trim()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var trimmed = ' foo '; | |
trimmed = trimmed.trim(); // returns 'foo' | |
// ES5 also allows for access to characters at specific indices via the bracket notation | |
trimmed[0]; // returns "f" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment