Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.



Get Started Now!

JAVASCRIPT METHODS

  1. length // it is a property
  2. toLowerCase()
  3. toUpperCase()
  4. Includes()
  5. startsWith()
  6. endsWith()
  7. search()
  8. match()
  9. indexOf()
  10. lastIndexOf()
  11. replace()
  12. trim()
  13. charAt()
  14. charCodeAt()
  15. fromCharCode()
  16. concat()
  17. Split()
  18. repeat()
  19. slice()
  20. substr()
  21. substring()
  22. toString()
  23. valueOf()
  1. length() //It is a property

Example:-

Output: 30

2. toLowerCase() //Methods are having round brackets

Example:-

Output: javascript is a great language

3. toUpperCase()

Example:

Output: JAVASCRIPT IS A GREAT LANGUAGE

4. includes()

Includes use to find text or word form content . It shows result in true or false.

It is case sensitive method.

Example:

Output: true

5. startsWith()

It returns the first word or character of the sentence

It is a case sensitive method

Example:

Output: true

6. endsWith()

It returns the last word or character of the sentence

It is a case sensitive method

Example:

Output: true

 7.   Search()

It search word and show the index value.

If this method didn’t find anything then it returns -1

Example:

Output: 11

8. match()

It match the word and make it array

Example:

Output: is,is

9. indexOf()

It search position from start and returns index value

Example:

Output: 11

10. lastIndexOf()

It search position of last and returns index value

Example:

Output: 22

11. replace()

It replace the words

Example:

Output: python is a GREAT Language

12. trim()

Example:

Output: JavaScript is a GREAT Language

13. charAt()

It returns the position index value.

Example:

Output: a

14. charCodeAt()

It returns ascii code of given value.

Example:

Output: 97

15. formCharCode()

It shows the ASCII value of given value.

It doesn’t need any string it has inbuilt object

Example:

Output: A

ASCII code table

16. concat()

This function concat or add 2 or more strings.

Example:

Output:

JavaScript is a GREAT Language also python is great language

17. split()

It method use to make  array of string where we put split function

Example:

Output: JavaScript,is,a,GREAT,Language

18. repeat()

It repeat the string as our preference.

Example:

Output: JavaScript is a GREAT LanguageJavaScript is a GREAT Languageuage

19. slice()

It basic use two parameters first character shows for where starts(parameter1) the string with and second parameters shows to the end.

Example:

Output: vaScript is a

20. substr()

It is work similarly as slice but it count value where first parameter is starts.

Example:

Output: vaSc

21. substring()

It is work similarly as substr but it when show parameter2 then it shows less 1 charecter(if we write 5th place it retuns 4th place value)

Example:

Output: vaS

22. toString()

It converts datatype to the string.

Output: 55 (as a string)

23. valueOf()

This function is default, It show string as it is.

Output: JavaScript is a GREAT Language

Related Posts

How We Fixed “sonar-scanner: command not found” and Successfully Analyzed Our Project with SonarQube

Running static code analysis with SonarQube is essential for maintaining clean, quality code. Recently, while working on our Laravel microservice project mhn-doctors-ms, we hit a common yet…

Is SonarQube Community free Edition Good for Laravel Projects?

When working on web development projects using Laravel, JavaScript, and jQuery, maintaining code quality becomes just as important as building features. That’s where tools like SonarQube come…

Laravel Throttle Middleware: How to Increase API Rate Limit Safely and for 429 Too Many Requests

If you’re working with Laravel APIs, you might have encountered this default throttle setting: This line lives in your app/Http/Kernel.php file and controls how many requests a…

Fixing MySQL Error: Incorrect Definition of mysql.column_stats Table

The Problem While working on your MySQL server, you might come across this error in your error log: This error usually shows up after an upgrade or…

Fixing Laravel Migration Error: “Unknown Collation: utf8mb4_0900_ai_ci”

While working with Laravel and MySQL, you might run into an error during migrations like this one: Why This Happens The collation utf8mb4_0900_ai_ci is introduced in MySQL…

Why Dental Surgery Is Good and Important

Dental health plays a vital role in our overall well-being, yet it’s often overlooked until problems become serious. Dental surgery is a powerful solution that not only…

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x