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
console.log()– prints a message to the console.alert()– displays a message in a dialog box.prompt()– displays a dialog box that prompts the user for input.confirm()– displays a dialog box that prompts the user to confirm an action.typeof()– returns the data type of a variable.parseInt()– converts a string to an integer.parseFloat()– converts a string to a floating-point number.isNaN()– checks whether a value is not a number.String()– converts a value to a string.Array()– creates a new array.push()– adds an element to the end of an array.pop()– removes the last element from an array.shift()– removes the first element from an array.unshift()– adds an element to the beginning of an array.slice()– returns a portion of an array.indexOf()– returns the index of the first occurrence of a value in an array.lastIndexOf()– returns the index of the last occurrence of a value in an array.join()– joins all elements of an array into a string.sort()– sorts the elements of an array.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.
