JavaScript contains a number of built-in functions and also
allows you to create your own functions. Some examples of built in functions
are:
·
alert(): This function is used to display messages, variables, or numbers
to user in a rectangular window that has OK button in it.
·
Confirm():This function is quite similar to the alert function. However
it shows two buttons OK and Cancel and allows the user to make a decision.
·
toString(): This function returns the string representation of the number’s
value.
·
valueOf(): This function returns the number’s value.
·
Length(): This function returns the length of a string.
·
indexOf(): This function returns the index within the calling string object
of the first occurrence of the specified value. It returns -1 if the value
is not found
|