Www.JavaBasics.We.Bs

home HOME

JS Basic
JS HOME
JS Introduction
JS How To
JS Where To
JS Variables
JS Operators
JS Functions
JS Conditional
JS Looping
JS Guidelines

JS References
JS Array
JS Boolean
JS Date
JS Math
JS String
JS HTML DOM

Examples/Quiz
JS Basic Examples
JS Core Examples
JS DOM Examples
JS Quiz


JavaScript Core Objects Examples

previous next


These are examples of using the built-in JavaScript objects.


Note: Most of the examples require IE 4.0+, Netscape 7+, or Opera 7+!

String Object

Count characters in a string (length() method)
Test if a string contains a specified text (indexOf() method)
Test if a string contains a specified text (match() method)
Return a specified part of a string (substr() method)
Uppercase or lowercase characters? (toLowerCase() and toUpperCase() methods)

Array Object

Create an array with a numeric parameter and assign data to it
Create a literal array
Array - some properties and methods
Array - concat() and slice()

Date Object

Today's date
Current local time
Set date
UTC time
Display current weekday
Display a complete date with the name of the day and the name of the month
Running clock

Math Object

Round a number to the nearest whole number (round() method)
Random number between 0 and 1 (random() method)
Random number from 0-10 (random() method and round() method)
Test which of two numbers, has the highest value (max() method)
Test which of two numbers, has the lowest value (min() method)
Convert Celsius to Fahrenheit
Convert a character to Unicode


previous next





Copyright © 2007-2008, Www.JavaBasics.We.Bs All rights reserved.