JavaScript Objects Examples
Use the built-in JavaScript object instance.
String object
Returns the position of the first occurrence of the specified text in the string - indexOf() method
Find a specific character in a string, if found, return the character - match() method
More examples of string objects can be found in our JavaScript String Object Reference manual .
Date object
Use getTime() to calculate how many milliseconds there are from 1970 to today
Use toUTCString() to convert the date of the day (according to UTC) to a string
Use getDay() to display the day of the week, not just the number
More examples of Date objects can be found in our JavaScript Date Object Reference manual .
Array object
Add an element to the second position of the array - splice()
For more examples of Array objects, see our JavaScript Array object reference manual .
Boolean object
More examples of Boolean objects can be found in our JavaScript Boolean object reference manual.
Math object
Others
More Math object examples are in our JavaScript Math Object Reference manual .