HTML and CSS Reference
In-Depth Information
EXPLANATION
2
The property
length
of the string object called
yourname
is printed. Because the
object is enclosed within a block following the
with
keyword, the name of the ob-
ject is omitted.
3
The to
UpperCase()
method caused the
str
object's character to be capitalized.
4
The
toLowerCase()
method caused the string to be lowercased.
Figure 9.40
The
with
keyword and strings.
In the last chapter you learned how to create and manipulate your own objects, and in
this chapter we concentrated on the built-in core objects of JavaScript and what proper-
ties and methods are provided for these objects. You learned about the Array object so
that later you can create arrays of images and links, and so on. You learned how to
manipulate time and dates and how to manage strings and numbers. All of these objects
are vital to working with JavaScript as they are at the heart of all JavaScript programs. At
this time you should know:
1. What JavaScript's core types are.
2. How to create an Array object with the
new
constructor.
3. How to find the size of an array.
4. How to create a literal array.
5. How to populate an array.
6. How to loop through an array.
7. How to create a two-dimensional array.
8. How to add and remove elements from an array.
9. The difference between slicing and splicing an array.
10. Five ways to instantiate a date object.
11. How JavaScript stores dates.
12. How to calculate the difference between two dates.
13. How to get the current year and month.
14. How to customize the Date object.