Last active
June 2, 2017 03:32
-
-
Save nicco88/24a5ff79a17962ce8b6912ea6448e2c7 to your computer and use it in GitHub Desktop.
JS notes
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 stringOne = "Hey there, how are you doing?", | |
stringTwo = "I'm doing great, thank you!"; | |
// charAt() → it outputs the indicated index | |
console.log(stringOne.charAt(0)); | |
// charCodeAt() → it returns the unicode number | |
console.log(stringOne.charCodeAt(0)); | |
// concat() → it concatenates two or more strings | |
console.log(stringOne.concat(" ", stringTwo)); | |
// endsWith() → it returns a boolean | |
console.log(stringOne.endsWith("doing?")); | |
// String.fromCharCode() → it returns the corresponding character | |
console.log(String.fromCharCode(114)); | |
// includes() → it returns a boolean | |
console.log(stringOne.includes("you")); | |
// indexOf() → it returns the number value of the first element that matches | |
console.log(stringOne.indexOf("there")); // → 4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment