December 21, 2022
Estimated Post Reading Time ~ 1 mins

JOURNEY WITH JAVASCRIPT

JOURNEY WITH JAVASCRIPT

"Strings" in javascript Most frequently used string methods that are asked in interviews as well.

.com/media/


In JavaScript, a string is a sequence of characters enclosed in quotation marks. For example: let str = "This is a string."; Strings in JavaScript can be manipulated using a number of built-in methods.

1. chatAt( ) It returns the character at a specified index in the string

.com/media/


2. concat( ) The `concat( )` method concatenates (joins) two or more strings and returns a new string.

.com/media/


3. includes( ) The `includes( )` method determines whether a string contains a specified substring and returns a boolean value

.com/media/


4. indexOf( ) The `indexOf( )` method returns the index of the first occurrence of a specified substring in the string

.com/media/


5. replace( ) The `replace()` method replaces a specified substring with another substring and returns a new string

.com/media/


6. slice( ) The `slice( )` method extracts a section of a string and returns a new string.

.com/media/


7. split( ) The `split( )` method splits a string into an array of substrings and returns the new array.


8. endsWith( ) `endsWith( )` method is a string method that determines whether a string ends with the specified substring and returns a boolean value.

.com/media/


9. toUpperCase( ) and toLowerCase( ) The `toLowerCase( )` and `toUpperCase( )` methods convert a string to lowercase or uppercase, respectively.

.com/media/


10. repeat( ) The `repeat()` method returns a new string with the original string repeated the specified number of times. `repeat()` method is not supported in all browsers, so you may need to include a polyfill in your code to ensure compatibility with older browsers.

.com/media/


You can learn more about strings and their methods on the JavaScript documentation website. Resources

.com/card_img/1602460875478089729/

github.com
Learn-JavaScript/resources.md at main ยท deeqakkk/Learn-JavaScript
Contribute to deeqakkk/Learn-JavaScript development by creating an account on GitHub.

Source:
aem4beginner.blogspot


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.

Ad Blocker Detected :(

Please consider supporting us by disabling your ad blocker.

Please Disable your adblocker and Refresh the page to view the site content.