This site will look much better in a browser that supports web standards, but it is accessible to any browser or Internet device.
Date objects
This question tests your knowledge of JavaScript objects and methods.
Hopefully you will realise that this approach to storing and accessing data is an improvement on the data structure presented in Q9.
Q10.
You are required to model a mountain with an object. You will need to write
a constructor, which takes two explicit arguments. Mountain will
require two properties, name and height.
Write JavaScript for the constructor, instantiate a Mountain
object and initialize the properties of this object, which represents Mount
Everest (see output below for values).
Now implement a method toString(), which gets the values of the
name and height properties of a Mountain
object and outputs them in an alert box. Test this method on the object you
created.
Next page » Event-driven programming
Previous page « Arrays