JavaScript Built in Functions

please click here for more wordpress cource

JavaScript has a rich set of built-in functions, also known as methods or functions, that perform common operations and calculations. Here are some of the most commonly used ones:

If you want to display massage in php click here for more details

  1. console.log() – prints a message to the console.
  2. alert() – displays a message in a dialog box.
  3. prompt() – displays a dialog box that prompts the user for input.
  4. confirm() – displays a dialog box that prompts the user to confirm an action.
  5. typeof() – returns the data type of a variable.
  6. parseInt() – converts a string to an integer.
  7. parseFloat() – converts a string to a floating-point number.
  8. isNaN() – checks whether a value is not a number.
  9. String() – converts a value to a string.
  10. Array() – creates a new array.
  11. push() – adds an element to the end of an array.
  12. pop() – removes the last element from an array.
  13. shift() – removes the first element from an array.
  14. unshift() – adds an element to the beginning of an array.
  15. slice() – returns a portion of an array.
  16. indexOf() – returns the index of the first occurrence of a value in an array.
  17. lastIndexOf() – returns the index of the last occurrence of a value in an array.
  18. join() – joins all elements of an array into a string.
  19. sort() – sorts the elements of an array.
  20. reverse() – reverses the order of elements in an array.

These are just a few examples of the many built-in functions available in JavaScript. The full list can be found in the official documentation.

You may also like...

Popular Posts

Leave a Reply

Your email address will not be published. Required fields are marked *