JS References

JS Objects
JS HTML DOM

Suscriber with us



Receive HTML?

Syndicate

Object Examples PDF Print E-mail

Examples of using the built-in JavaScript objects.

String Object

Return the length of a string
Style strings
Return the position of the first occurrence of a text in a string - indexOf()
Search for a text in a string and return the text if found - match()
Replace characters in a string - replace()

More String object examples

Date Object

Use Date() to return today's date and time
Use getTime() to calculate the years since 1970
Use setFullYear() to set a specific date
Use toUTCString() to convert today's date (according to UTC) to a string
Use getDay() and an array to write a weekday, and not just a number
Display a clock

More Date object examples

Array Object

Create an array
Use a for...in statement to loop through the elements of an array
Join two arrays - concat()
Put array elements into a string - join()
Literal array - sort()
Numeric array - sort()

More Array object examples

Boolean Object

Check Boolean value

More Boolean object examples

Math Object

Use round() to round a number
Use random() to return a random number between 0 and 1
Use max() to return the number with the highest value of two specified numbers
Use min() to return the number with the lowest value of two specified numbers
Convert Celsius to Fahrenheit

More Math object examples





Digg!Del.icio.us!Google!Live!Facebook!Slashdot!Technorati!StumbleUpon!Newsvine!Yahoo!Free social bookmarking plugins and extensions for Joomla! websites!
Last Updated ( Thursday, 13 March 2008 )
 
< Prev   Next >

Polls

Which is the best Scripting language?