Important Built in Methods

Important Built in Methods

Interview Question

Table of contents

No heading

No headings in the article.

JavaScript has many built-in methods that provide useful functionality for working with data, strings, arrays, dates, and more. Here are some important built-in methods in JavaScript:

  1. alert() - displays a message in a dialog box.

  2. console.log() - writes a message to the browser console.

  3. parseInt() - converts a string to an integer.

  4. parseFloat() - converts a string to a floating-point number.

  5. toString() - converts a value to a string.

  6. toUpperCase() - converts a string to uppercase.

  7. toLowerCase() - converts a string to lowercase.

  8. concat() - concatenates two or more strings.

  9. indexOf() - returns the index of the first occurrence of a specified value in a string or array.

  10. lastIndexOf() - returns the index of the last occurrence of a specified value in a string or array.

  11. slice() - extracts a section of a string or array and returns it as a new string or array.

  12. splice() - adds or removes elements from an array.

  13. sort() - sorts the elements of an array.

  14. reverse() - reverses the order of the elements in an array.

  15. join() - joins all elements of an array into a string.

  16. push() - adds an element to the end of an array.

  17. pop() - removes the last element of an array.

  18. shift() - removes the first element of an array.

  19. unshift() - adds an element to the beginning of an array.

  20. toString() - converts an array to a string.

Did you find this article valuable?

Support Shiv singh bahel by becoming a sponsor. Any amount is appreciated!