Created
September 3, 2019 15:50
-
-
Save djD-REK/81d39bb8f5b231084f433e1e9a769c66 to your computer and use it in GitHub Desktop.
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
const myString = " Hello world! "; | |
console.log(myString.trim()); // The leading and trailing whitespace are removed: "Hello world!" | |
console.log(myString); // The original string remains unchanged: " Hello world! " | |
// String.prototype.trim() is used with a . (dot-reference operator), not: | |
trim(myString); | |
// This would result in "ReferenceError: trim is not defined" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment